/* ===================================
   DarkTime — Landscape Only
   =================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none; 
    -ms-user-select: none;  
    user-select: none;          
    font-family: 'JetBrains Mono', monospace !important;
}

html, body {
    background: #000;
    height: 100%;
    width: 100%;
    overflow: hidden;
    cursor: default;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
}

.hero {
    width: 100%;
    height: 100vh;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Landscape Container */
.container {
    width: 80vw; 
    background-color: transparent;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Horizontal Layout */
.clock {
    display: flex;
    flex-direction: row; /* Force horizontal */
    align-items: center;
    justify-content: center;
    gap: 2vw; 
}

.clock span {
    font-family: 'JetBrains Mono', monospace !important;
    font-size: clamp(5rem, 30vw, 17rem); 
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
    position: relative;
    padding-bottom: 6vh; 
    font-variant-numeric: tabular-nums;
}

/* Labels below digits */
.clock span::after {
    font-size: clamp(1rem, 2.2vw, 2rem);
    position: absolute;
    bottom: 1.5vh;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.15em;
    white-space: nowrap;
}

/* Dots (Colons) - Visible in Landscape */
.clock .dot {
    display: block; 
    font-size: clamp(5rem, 18vw, 22rem);
    color: #ffffff;
    opacity: 0.5;
}

.datetime-wrapper {
    margin-top: 2rem;
    display: flex;
    flex-direction: row; /* Force horizontal */
    gap: 4rem;
}

.date, .day {
    font-size: clamp(1rem, 2.5vw, 2rem);
    color: white;
    font-weight: 700;
    letter-spacing: 0.1em;
}

/* Update the existing .day class */
.day {
    font-size: clamp(1rem, 2.5vw, 2rem);
    color: white;
    font-weight: 700;
    letter-spacing: 0.1em;
    /* Added for line positioning */
    position: relative; 
    text-transform: uppercase;
    display: inline-block; /* Ensures lines stay relative to text width */
}

/* Add these pseudo-elements to create the lines */
.day::before,
.day::after {
    content: '';
    position: absolute;
    top: 50%;
    width: clamp(12px, 3.5vw, 24px); /* Responsive line width */
    height: 1px;
    background: rgba(255, 255, 255, 0.15); /* Subtle line color */
}

/* Positioning the lines on either side */
.day::before { 
    right: calc(100% + 15px); /* Gap between text and left line */
}

.day::after { 
    left: calc(100% + 15px);  /* Gap between text and right line */
}


/* Label content injection */
#hr::after { content: 'HOURS ' attr(data-ampm); }
#min::after { content: 'MINUTES'; }
#sec::after { content: 'SECONDS'; }

/* Landscape Mobile Adjustments */
@media (max-width: 900px) {
    .container {
        width: 95vw;
        padding: 1.5rem 1rem;
    }
    .clock span, .clock .dot {
        font-size: 8vw;
        padding-bottom: 2rem;
    }
    .datetime-wrapper {
        margin-top: 0.5rem;
        gap: 2rem;
    }
}

/* Tablet & Large Screen Landscape Scaling */
@media (min-width: 901px) {
    .clock span, .clock .dot {
        font-size: 12vw;
    }
}

@media (min-width: 1920px) {
    .clock span, .clock .dot {
        font-size: 15rem;
    }
}

/* ── NEW: 2400px+ Ultra-Wide Optimization ── */
@media (min-width: 2400px) {
    .container {
        max-width: 2300px;
    }
        
    .clock {
        gap: 1vw; /* Tighter gap for massive scale */
    }

    .clock span {
        font-size: 25rem; /* Massive static size for 4K */
        padding-bottom: 80px;
    }

    .clock .dot {
        font-size: 20rem;
        padding-bottom: 70px;
    }

    .clock span::after {
        font-size: 1.8rem;
        bottom: 15px;
    }

    .date, .day {
        font-size: 2.5rem;
    }
    
    .datetime-wrapper {
        margin-top: 3rem;
        gap: 6rem;
    }
}

/* ── Modern Glass Toast Notification ── */
.toast {
    position: fixed;
    top: 30px;
    right: 30px;
    /* Glass Effect */
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    
    padding: 1.2rem 2rem;
    border-radius: 14px;
    color: white;
    font-size: 0.95rem;
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    
    /* Animation Initial State */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px) scale(0.95);
    transition: 
        opacity 0.8s ease, 
        transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        visibility 0.8s;
}

/* State triggered by JS toast.classList.add('show') */
.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.toast strong {
    color: var(--white);
    margin-right: 5px;
    letter-spacing: 0.05em;
}

/* Responsive adjustment for small screens */
@media (max-width: 600px) {
    .toast {
        top: 20px;
        right: 20px;
        left: 20px; /* Center it on mobile */
        text-align: center;
        font-size: 0.85rem;
        padding: 1rem;
    }
}






/* Portrait specific behavior */
@media (orientation: portrait) {
    body.hide-ui .clock span {
        opacity: 0.8; /* Slightly dim clock for a 'sleep' effect */
        transition: opacity 0.8s ease;
    }
}


/* ── Mobile Portrait Override ──────────────── */

@media (orientation: portrait) {
  /* Stack the clock units vertically */
  .clock {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  /* Hide colons (dots) in portrait */
  .clock .dot {
    display: none;
  }

  /* Reset individual time units for vertical stack */
  .clock span {
    display: flex;
    flex-direction: column; /* This forces the label UNDER the digit */
    align-items: center;
    width: 100%;
    text-align: center;
    font-size: clamp(90px, 50vw, 200px);
    padding-bottom: clamp(14px, 4vw, 32px);
    margin-bottom: 0px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  /* Remove border from the last unit (seconds) */
  #sec {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
  }

  /* Fix labels to stay under the digits */
  .clock span::after {
    position: static; /* Removes absolute positioning from landscape */
    transform: none;
    display: block;
    margin-top: 0px;
    font-size: clamp(11px, 6vw, 40px);
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.3em;
  }

  /* Adjust Date/Day wrapper */
  .datetime-wrapper {
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-top: 0;
    margin-bottom: 0;
    order: -1; /* Keeps date at the top */
  }

  .date {
    margin-top: 10px;
    font-size: clamp(20px, 7vw, 40px);
  }

  .day {
    font-size: clamp(20px, 15vw, 45px);
    color: rgba(255, 255, 255, 0.4);
  }  
}