/*
 * Custom styles for George's CV
 * Extends the FolioOne template with light/dark theme toggle,
 * profile photo sizing, and minor layout tweaks.
 */

/* =====================================================================
   Light Theme — overrides template's dark defaults
   ===================================================================== */

[data-theme="light"] {
  --background-color: #f5f8fa;
  --default-color: #2d3748;
  --heading-color: #1a202c;
  --accent-color: #1387c1;
  --surface-color: #ffffff;
  --contrast-color: #ffffff;
}

[data-theme="light"] {
  --nav-color: #2d3748;
  --nav-hover-color: #1387c1;
  --nav-mobile-background-color: #ffffff;
  --nav-dropdown-background-color: #ffffff;
  --nav-dropdown-color: #2d3748;
  --nav-dropdown-hover-color: #1387c1;
}

[data-theme="light"] .light-background {
  --background-color: #ffffff;
  --surface-color: #f0f4f8;
}

[data-theme="light"] .dark-background {
  --background-color: #1387c1;
  --default-color: #ffffff;
  --heading-color: #ffffff;
  --surface-color: rgba(255, 255, 255, 0.15);
  --contrast-color: #ffffff;
}

/* Remove underline from hero name */
.hero .hero-content h1 .highlight::after {
  display: none;
}

/* Smooth colour transitions between themes */
body,
.header,
section,
.skill-box,
.resume-item,
.fact-pill,
.navmenu,
.navmenu ul {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Hide Vue template markup before mount */
[v-cloak] { display: none; }

/* =====================================================================
   Theme Toggle Button
   ===================================================================== */

.theme-toggle-btn {
  border: none;
  background: none;
  color: var(--nav-color);
  width: 52px;
  height: 52px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 1.875rem;
  transition: color 0.25s ease;
}

.theme-toggle-btn:hover {
  color: var(--accent-color);
}

/* =====================================================================
   Language Toggle Button
   ===================================================================== */

.lang-toggle-btn {
  border: none;
  background: none;
  color: var(--nav-color);
  width: 40px;
  height: 52px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 1.3rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.04em;
  transition: color 0.25s ease;
}

.lang-toggle-btn:hover {
  color: var(--accent-color);
}

/* =====================================================================
   Profile Photo
   ===================================================================== */

.profile-photo {
  max-width: 400px;
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: cover;
  object-position: center top;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  display: block;
  margin: 0 auto;
}

[data-theme="light"] .profile-photo {
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.12);
}

/* =====================================================================
   Fact pills — prevent text wrapping
   ===================================================================== */

.about .fact-pill {
  white-space: nowrap;
}

/* =====================================================================
   Title text gradient
   ===================================================================== */

.section-title h2,
.resume-title {
  background: linear-gradient(135deg,
    var(--heading-color) 30%,
    color-mix(in srgb, var(--accent-color), var(--heading-color) 55%)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =====================================================================
   Header social link icons
   ===================================================================== */

.header .header-social-links .header-icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: none;
  background: none;
  color: var(--nav-color);
  font-size: 1.875rem;
  flex-shrink: 0;
  text-decoration: none;
  transition: color 0.25s ease;
}

.header .header-social-links .header-icon-link:hover {
  color: var(--accent-color);
}

/* Override template's font-size: 16px and line-height: 0 on icons */
.header .header-social-links .header-icon-link i,
.theme-toggle-btn i {
  font-size: 1.875rem;
  line-height: 1;
}

/* =====================================================================
   Skills Section — animated progress bars
   ===================================================================== */

.skill-box .progress-bar,
.resume-item .progress-bar {
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =====================================================================
   Experience Tags
   ===================================================================== */

.exp-tag {
  font-size: 0.72rem;
  font-weight: 500;
  background-color: color-mix(in srgb, var(--accent-color) 15%, transparent);
  color: var(--accent-color);
  border: 1px solid color-mix(in srgb, var(--accent-color) 30%, transparent);
  border-radius: 4px;
  padding: 2px 7px;
}

/* =====================================================================
   Background gradient
   ===================================================================== */

body {
  background-image: linear-gradient(
    160deg,
    color-mix(in srgb, var(--background-color), var(--accent-color) 6%) 0%,
    var(--background-color) 40%
  );
  background-attachment: fixed;
}

/* =====================================================================
   Button gradients — applied globally to all button types
   ===================================================================== */

/* Primary buttons */
.btn.btn-primary {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent-color), white 22%),
    color-mix(in srgb, var(--accent-color), black 10%)
  );
  border-color: transparent;
}

.btn.btn-primary:hover {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent-color), white 12%),
    color-mix(in srgb, var(--accent-color), black 20%)
  );
  border-color: transparent;
}

/* Outline buttons (hero) */
.btn.btn-outline {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent-color), transparent 82%),
    transparent
  );
}

.btn.btn-outline:hover {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent-color), transparent 68%),
    color-mix(in srgb, var(--accent-color), transparent 82%)
  );
}

/* Contact primary button — restore border to match outline-light sibling */
.contact .btn.btn-primary {
  border: 1px solid rgba(255, 255, 255, 0.45);
}

/* Outline-light buttons (contact section) */
.btn.btn-outline-light {
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.14),
    rgba(255, 255, 255, 0.04)
  );
}

.btn.btn-outline-light:hover {
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.24),
    rgba(255, 255, 255, 0.10)
  );
}

/* =====================================================================
   Flag balls
   ===================================================================== */

.flag-ball {
  display: inline-block;
  position: relative;
  width: 1.5em;
  height: 1.5em;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 1px solid color-mix(in srgb, var(--accent-color) 30%, transparent);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  cursor: default;
  user-select: none;
  flex-shrink: 0;
  vertical-align: middle;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.flag-ball:hover {
  transform: scale(1.28);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent-color) 40%, rgba(0,0,0,0.3));
}

.flag-ball::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%) scale(0.85);
  background: var(--surface-color);
  color: var(--default-color);
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: 5px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 100;
}

.flag-ball:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* =====================================================================
   Loading state
   ===================================================================== */

.cv-loading {
  min-height: 70vh;
}

/* =====================================================================
   Contact Section
   ===================================================================== */

.contact.dark-background .btn-outline-light {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.contact.dark-background .btn-outline-light:hover {
  background-color: #fff;
  color: var(--accent-color);
}

/* =====================================================================
   Responsive tweaks
   ===================================================================== */

@media (max-width: 768px) {
  .profile-photo {
    max-width: 280px;
    max-height: 320px;
  }
}
