/* ========================
   Color System & Themes
   ======================== */

/* Deco theme (default) */
:root,
:root[data-design="deco"] {
  --font-display: 'Yeseva One', 'Montserrat', 'Raleway', system-ui, sans-serif;
  --font-sans: 'Raleway', 'Montserrat', system-ui, sans-serif;

  /* Light theme colors */
  --color-bg: #f5fdf9;
  --color-bg-accent: #e9f7f0;
  --color-card: #ffffffcc;
  --color-border: #b9e6d3;
  --color-border-strong: #64b891;
  --color-text: #1e3228;
  --color-text-muted: #587766;
  --color-accent: #ff8eea;
  --shadow: 0 4px 22px -10px rgba(30, 50, 40, 0.25);
  --focus-ring: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-accent);
  --dropdown-arrow: #64b891;
  
  /* Polaroid styling */
  --polaroid-bg: #ffffff;
  --polaroid-img-filter: brightness(1);
}

/* Deco dark theme */
:root[data-design="deco"][data-theme="dark"] {
  --color-bg: #0d1c16;
  --color-bg-accent: #12251d;
  --color-card: #162f25cc;
  --color-border: #2d5747;
  --color-border-strong: #4d9c79;
  --color-text: #dff6ec;
  --color-text-muted: #93b6a7;
  --shadow: 0 4px 28px -8px rgba(0, 0, 0, 0.55);
  --polaroid-bg: #1a2e27;
  --polaroid-img-filter: brightness(0.95);
  --dropdown-arrow: #4d9c79;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-design]):not([data-theme]) {
    --color-bg: #0d1c16;
    --color-bg-accent: #12251d;
    --color-card: #162f25cc;
    --color-border: #2d5747;
    --color-border-strong: #4d9c79;
    --color-text: #dff6ec;
    --color-text-muted: #93b6a7;
    --shadow: 0 4px 28px -8px rgba(0, 0, 0, 0.55);
    --polaroid-bg: #1a2e27;
    --polaroid-img-filter: brightness(0.95);
    --dropdown-arrow: #4d9c79;
  }
}

/* ========================
   Card Styling
   ======================== */
.card {
  background: var(--color-card);
  backdrop-filter: blur(10px) saturate(160%);
  border-radius: 1.4rem;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow);
  color: var(--color-text);
}

.name {
  color: var(--color-text);
}

.tagline {
  color: var(--color-text-muted);
}

/* ========================
   Polaroid Styling
   ======================== */
.polaroid {
  background: var(--polaroid-bg);
  border: 1px solid var(--color-border);
  border-radius: 1.4rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px) saturate(140%);
}

.polaroid img {
  border-radius: 0.9rem;
  filter: var(--polaroid-img-filter);
}

/* ========================
   Button Styling
   ======================== */
.btn {
  --btn-border: var(--color-border-strong);
  color: var(--color-text);
  border: 1px solid var(--btn-border);
  border-radius: 999px;
}

.btn::before {
  border-radius: 999px;
  background: linear-gradient(120deg, var(--color-accent) 0%, transparent 70%);
}

.btn:hover,
.btn:focus-visible {
  border-color: var(--color-accent);
}

/* Brand-specific button colors */
.btn--linkedin {
  --btn-border: #0a66c2;
}

.btn--linkedin:hover,
.btn--linkedin:focus-visible {
  background-color: #0a66c2;
  border-color: #0a66c2;
  color: #ffffff;
}

.btn--linkedin:hover::before,
.btn--linkedin:focus-visible::before {
  opacity: 0;
}

.btn--github {
  --btn-border: #24292f;
}

.btn--github:hover,
.btn--github:focus-visible {
  background-color: #24292f;
  border-color: #24292f;
  color: #ffffff;
}

.btn--github:hover::before,
.btn--github:focus-visible::before {
  opacity: 0;
}

.btn--unsplash {
  --btn-border: #000000;
}

.btn--unsplash:hover,
.btn--unsplash:focus-visible {
  background-color: #000000;
  border-color: #000000;
  color: #ffffff;
}

.btn--unsplash:hover::before,
.btn--unsplash:focus-visible::before {
  opacity: 0;
}

/* Dark theme button adjustments */
:root[data-theme="dark"] .btn--github {
  --btn-border: #c9d1d9;
}

:root[data-theme="dark"] .btn--github:hover,
:root[data-theme="dark"] .btn--github:focus-visible {
  background-color: #f6f8fa;
  border-color: #f6f8fa;
  color: #24292f;
}

:root[data-theme="dark"] .btn--unsplash {
  --btn-border: #ffffff;
}

:root[data-theme="dark"] .btn--unsplash:hover,
:root[data-theme="dark"] .btn--unsplash:focus-visible {
  background-color: #ffffff;
  border-color: #ffffff;
  color: #000000;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .btn--github {
    --btn-border: #c9d1d9;
  }

  :root:not([data-theme]) .btn--github:hover,
  :root:not([data-theme]) .btn--github:focus-visible {
    background-color: #f6f8fa;
    border-color: #f6f8fa;
    color: #24292f;
  }

  :root:not([data-theme]) .btn--unsplash {
    --btn-border: #ffffff;
  }

  :root:not([data-theme]) .btn--unsplash:hover,
  :root:not([data-theme]) .btn--unsplash:focus-visible {
    background-color: #ffffff;
    border-color: #ffffff;
    color: #000000;
  }
}

/* ========================
   Theme Toggle Styling
   ======================== */
.theme-toggle__switch {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px) saturate(160%);
}

.theme-toggle__switch:hover,
.theme-toggle__switch[aria-pressed="true"] {
  border-color: var(--color-border-strong);
}

.theme-toggle__icon {
  color: var(--color-text);
}

.theme-toggle__slider {
  background: var(--color-border);
}

/* Light mode slider */
:root[data-theme="light"] .theme-toggle__switch {
  border-color: var(--color-border-strong);
}

:root[data-theme="light"] .theme-toggle__slider {
  background: var(--color-border-strong);
  transform: translate(0, -50%);
}

/* Dark mode slider */
:root[data-theme="dark"] .theme-toggle__slider {
  background: var(--color-border-strong);
}

/* Theme Dropdown Styling */
.theme-dropdown {
  background: var(--color-card);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 0.6rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px) saturate(160%);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  padding: 0.45rem 0.6rem;
  cursor: pointer;
  transition: all 0.3s ease;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1.2em;
  padding-right: 2rem;
  color: var(--color-text);
}

.theme-dropdown:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow), 0 0 0 3px var(--color-bg);
}

.theme-dropdown:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: var(--focus-ring);
}

.theme-dropdown option {
  background: var(--color-card);
  color: var(--color-text);
  font-family: var(--font-sans);
  padding: 0.5rem;
}

/* Responsive dropdown */
@media (max-width: 560px) {
  .theme-dropdown {
    font-size: 0.8rem;
    padding: 0.4rem 0.5rem;
    padding-right: 1.8rem;
  }
}
