/* =========================
   Space Galaxy — Header & Clock Container (NO media queries)
   Only styles for: header, .clock-container and direct children
   ========================= */

/* Color tokens for the space theme (we'll reuse later) */
:root {
    --bg-deep-1: #07051a;
    /* near-black deep space */
    --bg-deep-2: #0b1630;
    /* deep navy */
    --accent-1: #9be7ff;
    /* cool cyan */
    --accent-2: #caa4ff;
    /* soft purple */
    --glow: rgba(155, 231, 255, 0.18);
    --card-bg: rgba(10, 14, 30, 0.46);
    /* semi-transparent card */
    --glass-border: rgba(255, 255, 255, 0.06);
    --muted: rgba(255, 255, 255, 0.6);
    --max-width: 980px;
}

/* Basic reset relevant here */
* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    color: white;
    background: linear-gradient(180deg, var(--bg-deep-1), var(--bg-deep-2));
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2.5rem 1rem;
}

/* -------------------------
   Header
   ------------------------- */
header {
    width: 100%;
    max-width: var(--max-width);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
    text-align: center;
    margin-top: 2px;
}

/* App title — spacey but elegant */
.app-title {
    margin-bottom: 0;
    font-size:80px !important; 
    font-weight: 700;
    padding: 0px 20px 15px 20px;
    letter-spacing: 2px;
    font-size: clamp(1.1rem, 2.2vw, 1.6rem);
    /* responsive with clamp, not media queries */
    position: relative;
    line-height: 1;
    /* create subtle multi-layer glow using text-shadow */
    text-shadow:
        0 0 14px rgba(202, 164, 255, 0.12),
        0 0 30px rgba(155, 231, 255, 0.06);
}

/* Small subtitle or right-slot (reserved for future) */
header .right-slot {
    color: var(--muted);
    font-size: 0.9rem;
    opacity: 0.9;
}

/* -------------------------
   Clock container
   ------------------------- */
.clock-container {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 1.75rem;
    border-radius: 18px;
    background: var(--card-bg);
    /* semi-transparent card */
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    box-shadow:
        0 10px 30px rgba(2, 4, 12, 0.6),
        0 2px 8px rgba(155, 231, 255, 0.03);
    /* subtle cyan rim */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    transform: translateY(0);
    /* entrance animation (subtle) */
    opacity: 0;
    animation: clockFadeIn 700ms cubic-bezier(.22, .9, .32, 1) forwards;
}

/* Time display: big, legible, segment-friendly */
.time {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    font-weight: 700;
    /* use clamp for responsive size without media queries */
    font-size: clamp(2.4rem, 8vw, 6rem);
    letter-spacing: 0.02em;
    line-height: 1;
    color: white;
    position: relative;
}

/* Individual parts — easier to animate later */
.time .hours,
.time .minutes,
.time .seconds {
    display: inline-block;
    min-width: 0.6ch;
    /* prevents collapsing in weird fonts */
    padding: 0.08em 0.18em;
    border-radius: 8px;
    /* subtle internal shine using inner shadow (simulated) */
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.06));
    text-shadow: 0 2px 18px rgba(26, 32, 66, 0.45);
    /* depth */
}

/* Separator styling — thinner, slightly glowing */
.time .separator {
    font-weight: 600;
    opacity: 0.9;
    font-size: 0.85em;
    /* a bit smaller visually */
    color: var(--accent-1);
    text-shadow: 0 0 8px rgba(155, 231, 255, 0.12);
}

/* AM/PM badge */
.time .ampm {
    font-size: clamp(0.7rem, 1.4vw, 1rem);
    font-weight: 600;
    color: var(--accent-2);
    padding: 0.26rem 0.6rem;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(202, 164, 255, 0.06), rgba(155, 231, 255, 0.03));
    margin-left: 0.6rem;
    align-self: flex-end;
}

/* Date row below the time */
.date {
    font-size: clamp(0.875rem, 1.2vw, 1.05rem);
    color: var(--muted);
    letter-spacing: 0.3px;
    display: flex;
    gap: 0.4rem;
    align-items: center;
    justify-content: center;
    opacity: 0.95;
}

/* Controls (format/theme/settings) */
.controls {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    justify-content: center;
    margin-top: 0.35rem;
}

/* Basic button token — will be extended later */
.controls button {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0.45rem 0.65rem;
    border-radius: 10px;
    font-size: 0.95rem;
    color: var(--muted);
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: transform 150ms ease, background 180ms ease, color 180ms ease;
}

/* Hover/active micro-interaction */
.controls button:focus,
.controls button:hover {
    transform: translateY(-3px);
    color: white;
}

/* -------------------------
   Animations & accessibility
   ------------------------- */
@keyframes clockFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.995);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* === SETTINGS PANEL === */
#settings-panel {
  position: fixed;
  top:75%;
  right: 33%;
  transform: translateY(-50%) scale(1);
  background: rgba(20, 20, 35, 0.9);
  border: 1px solid rgba(130, 110, 255, 0.4);
  box-shadow: 0 0 25px rgba(130, 110, 255, 0.3);
  backdrop-filter: blur(12px);
  padding: 25px 30px;
  border-radius: 15px;
  width: 35vw;
  color: #fff;
  text-align: left;
  z-index: 999;
  transition: all 0.4s ease-in-out;
  opacity: 1;
  margin-top: 69px;
}

/* Hidden state */
#settings-panel.hidden {
  opacity: 0;
  transform: translateY(-50%) translateX(120%) scale(0.95);
  pointer-events: none;
}

/* Title */
#settings-panel h2 {
  margin-bottom: 20px;
  font-size: 1.5rem;
  color: #b8b8ff;
  text-shadow: 0 0 10px rgba(130, 110, 255, 0.7);
  border-bottom: 1px solid rgba(130, 110, 255, 0.3);
  padding-bottom: 8px;
}

/* Labels + Inputs */
#settings-panel label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 15px 0;
  font-size: 1rem;
  cursor: pointer;
}

#settings-panel input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #7f5af0;
  cursor: pointer;
}

/* Close button */
#close-settings {
  width: 100%;
  margin-top: 20px;
  background: linear-gradient(90deg, #7f5af0, #9b8bff);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 0;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 15px rgba(130, 110, 255, 0.3);
}

#close-settings:hover {
  background: linear-gradient(90deg, #9b8bff, #b6a8ff);
  box-shadow: 0 0 25px rgba(130, 110, 255, 0.6);
  transform: translateY(-2px);
}

/* === TIMEZONE DROPDOWN CONTAINER === */
.timezone {
  text-align: center;
  position: relative;
  z-index: 9999;
  margin-bottom: 20px;
  color: #fff;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  cursor: pointer;
}

/* Replace text-style p with a dropdown-style container */
.timezone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.08);
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid rgba(130, 110, 255, 0.4);
  box-shadow: 0 0 15px rgba(130, 110, 255, 0.3);
  backdrop-filter: blur(8px);
}

/* Flag icon (will be inside the span dynamically later) */
#timezone-label::before {
  content: "🇮🇳"; /* default India flag */
  font-size: 1.4rem;
  margin-right: 8px;
}

/* When dropdown is active (later JS toggle class) */
.timezone.active {
  box-shadow: 0 0 25px rgba(160, 130, 255, 0.6);
  transform: scale(1.03);
  transition: all 0.3s ease;
}

/* Timezone Dropdown Styles */
.timezone-dropdown {
    position: relative;
    width: 250px;
    user-select: none;
}

.selected-timezone {
    padding: 12px 20px;
    background: rgba(20, 20, 35, 0.95);
    border: 1px solid rgba(130, 110, 255, 0.4);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.selected-timezone:hover {
    background: rgba(30, 30, 45, 0.95);
    border-color: rgba(130, 110, 255, 0.6);
}

.timezone-options {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    background: rgba(20, 20, 35, 0.95);
    border: 1px solid rgba(130, 110, 255, 0.4);
    border-radius: 12px;
    padding: 8px 0;
    display: none;
    z-index: 9999;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.timezone-options.show {
    display: block;
    animation: fadeIn 0.25s ease-in-out;
}

.timezone-option {
    padding: 10px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.timezone-option:hover {
    background: rgba(130, 110, 255, 0.2);
}

/* Scrollbar styling for the options */
.timezone-options::-webkit-scrollbar {
    width: 8px;
}

.timezone-options::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.timezone-options::-webkit-scrollbar-thumb {
    background: rgba(130, 110, 255, 0.4);
    border-radius: 4px;
}

.timezone-options::-webkit-scrollbar-thumb:hover {
    background: rgba(130, 110, 255, 0.6);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Each country option */
.timezone-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 15px;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.timezone-option:hover {
  background: rgba(130, 110, 255, 0.2);
  transform: translateX(3px);
}

/* Flag inside dropdown */
.timezone-option .flag {
  font-size: 1.3rem;
}

body[data-theme="day"] {
  --bg-gradient: linear-gradient(180deg,#87CEEB,#0b3d91);
}
body[data-theme="sunrise"] {
  --bg-gradient: linear-gradient(180deg,#FFD89B,#19547b);
}
body[data-theme="sunset"] {
  --bg-gradient: linear-gradient(180deg,#ff9a9e,#f6c1ff);
}
body[data-theme="night"] {
  --bg-gradient: linear-gradient(180deg,#0b0f2b,#00121a);
}

/* then use the variable where you set background originally */
/* body { background: var(--bg-gradient); } */


/* -------------------------
   Media Queries
   ------------------------- */
@media screen and (max-width: 768px) {
    .app-title {
        font-size: 40px !important;
        padding: 0px 10px 10px 10px;
    }

    .clock-container {
        padding: 1.25rem;
        margin: 0 1rem;
    }

    .time {
        gap: 0.4rem;
        font-size: 4rem;
    }

    #settings-panel {
        width: 80vw;
        right: 10%;
        padding: 20px 25px;
    }

    .timezone-dropdown {
        width: 200px;
    }

    .timezone-options {
        width: 240px;
    }
}

@media screen and (max-width: 480px) {
    .app-title {
        font-size: 32px !important;
        padding: 0px 5px 5px 5px;
    }

    .time {
        font-size: 3rem;
        gap: 0.3rem;
    }

    .date {
        flex-direction: column;
        gap: 0.2rem;
    }

    .controls {
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .controls button {
        padding: 0.35rem 0.5rem;
        font-size: 0.9rem;
    }

    #settings-panel {
        width: 90vw;
        right: 5%;
        padding: 15px 20px;
    }

    .timezone {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .timezone-dropdown {
        width: 180px;
    }

    .timezone-options {
        width: 200px;
    }
}

@media screen and (max-width: 320px) {
    .app-title {
        font-size: 28px !important;
    }

    .time {
        font-size: 2.5rem;
        gap: 0.2rem;
    }

    .controls button {
        padding: 0.3rem 0.4rem;
        font-size: 0.85rem;
    }

    #settings-panel {
        width: 95vw;
        right: 2.5%;
        padding: 12px 15px;
    }
}


/* iPhone SE and similar devices (375px) */
@media screen and (max-width: 375px) {
    .app-title {
        font-size: 30px !important;
        padding: 0px 8px 8px 8px;
    }

    .clock-container {
        padding: 1rem;
        margin: 0 0.5rem;
    }

    .time {
        font-size: 2.8rem;
        gap: 0.2rem;
    }

    .time .hours,
    .time .minutes,
    .time .seconds {
        padding: 0.06em 0.14em;
    }

    .time .ampm {
        font-size: 0.8rem;
        padding: 0.2rem 0.4rem;
        margin-left: 0.4rem;
    }

    .date {
        font-size: 0.85rem;
        flex-direction: column;
        gap: 0.15rem;
    }

    .controls {
        gap: 0.3rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .controls button {
        padding: 0.3rem 0.4rem;
        font-size: 0.8rem;
    }

    #settings-panel {
        width: 92vw;
        right: 4%;
        top: 70%;
        padding: 15px;
        margin-top: 40px;
    }

    #settings-panel h2 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }

    #settings-panel label {
        font-size: 0.9rem;
        margin: 12px 0;
    }

    .timezone {
        padding: 8px 10px;
        font-size: 0.85rem;
    }

    .timezone-dropdown {
        width: 160px;
    }

    .timezone-options {
        width: 180px;
        max-height: 250px;
    }

    .selected-timezone {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .timezone-option {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}


/* ========== GitHub corner (top-right) ========== */
.github-link {
  position: fixed;
  top: 18px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 6px 20px rgba(2,4,12,0.6), 0 0 18px rgba(123, 95, 255, 0.06);
  color: #fff;
  text-decoration: none;
  backdrop-filter: blur(6px) saturate(120%);
  transform-origin: center;
  transition: transform 160ms cubic-bezier(.2,.9,.3,1), box-shadow 160ms, background 160ms;
  z-index: 1200; /* above most UI elements */
}

/* Slight hover/float animation */
.github-link:hover,
.github-link:focus {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 14px 40px rgba(123,95,255,0.18), 0 6px 26px rgba(2,4,12,0.6);
}

/* Icon styles */
.github-link .github-icon {
  width: 36px;
  height: 36px;
  display: inline-block;
  color: white;
  filter: drop-shadow(0 4px 18px rgba(123, 95, 255, 0.18));
  transition: transform 400ms cubic-bezier(.2,.9,.3,1), color 200ms;
}

/* small badge text (hidden on very small screens) */
.github-link .github-badge {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.92);
  letter-spacing: 0.3px;
  display: inline-block;
  white-space: nowrap;
}

/* subtle pulsing animation on the icon */
@keyframes githubPulse {
  0% { transform: translateY(0) scale(1); filter: drop-shadow(0 4px 18px rgba(123, 95, 255, 0.12)); }
  50% { transform: translateY(-3px) scale(1.03); filter: drop-shadow(0 8px 30px rgba(123, 95, 255, 0.22)); }
  100% { transform: translateY(0) scale(1); filter: drop-shadow(0 4px 18px rgba(123, 95, 255, 0.12)); }
}
.github-link .github-icon {
  animation: githubPulse 3200ms ease-in-out infinite;
}

/* Focus ring for accessibility */
.github-link:focus {
  outline: 3px solid rgba(155,231,255,0.08);
  outline-offset: 4px;
}

/* ========== Footer: centered attractive "Made by Sahil" ========== */
.site-footer {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 1100;
  pointer-events: none; /* ensures clicks go through except on interactive children */
}

.site-footer .madeby {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.05);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 8px 28px rgba(2,4,12,0.55);
  backdrop-filter: blur(6px);
  pointer-events: auto; /* allow click/hover on the footer badge if needed */
}

/* small animated heart accent */
.site-footer .heart {
  display:inline-block;
  color: #ff6b81;
  transform-origin: center;
  animation: heartBeat 1600ms ease-in-out infinite;
  font-size: 1.05rem;
  margin: 0 4px;
}

@keyframes heartBeat {
  0%,100%{ transform: scale(1); opacity: 0.9; }
  40%{ transform: scale(1.18); opacity: 1; }
}

/* prefix & name styling */
.site-footer .madeby-prefix { font-weight: 500; color: rgba(255,255,255,0.85); font-size: 0.85rem; }
.site-footer .madeby-name { font-weight: 700; background: linear-gradient(90deg,#fff,#d6d0ff); -webkit-background-clip: text; background-clip: text; color: transparent; padding-left:6px; }

/* small responsive tweak (no media queries requested, but keep small screens usable) */
