/**
 * ULTIMATE CLOCK FIX - FORCES SINGLE LINE
 * Load this AFTER all other CSS files
 */

/* Ensure site header can accommodate full clock width */
.site-header {
    overflow-x: auto !important;
    overflow-y: visible !important;
}

.site-header .container {
    min-width: fit-content !important;
}

/* NUCLEAR OPTION - Override EVERYTHING */
.header-clock {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    
    /* Position - aligned with header right edge */
    position: relative !important;
    margin-left: auto !important;
    padding-right: 0 !important;
    
    /* Spacing between elements */
    gap: 0.75rem !important;
    padding-left: 2rem !important;
    
    /* Size */
    min-width: 420px !important;
    width: 420px !important;
    max-width: 420px !important;
    height: auto !important;
    
    /* No breaking */
    white-space: nowrap !important;
    
    /* Flex behavior */
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    
    /* Vertical alignment to match nav */
    align-self: center !important;
}

/* Each clock element MUST stay inline */
.header-greeting,
.header-time,
.header-date,
.header-clock-divider {
    display: inline-block !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Greeting */
.header-greeting {
    font-size: 0.9rem !important;
    color: #0ea5e9 !important;
    opacity: 1 !important;
    white-space: nowrap !important;
    display: inline-block !important;
}

/* Time with glowing seconds */
.header-time {
    font-size: 1rem !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    opacity: 1 !important;
    white-space: nowrap !important;
    display: inline-block !important;
}

/* Glowing seconds effect - Fades out when seconds change */
.header-time .seconds {
    color: #0ea5e9 !important;  /* Cyan blue */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif !important;
    font-weight: 600 !important;  /* Match time weight */
    font-size: 1rem !important;  /* EXPLICIT: Same size as time (1rem) */
    /* Reduced brightness - subtle glow */
    text-shadow: 0 0 6px rgba(14, 165, 233, 0.6),
                 0 0 12px rgba(14, 165, 233, 0.4),
                 0 0 18px rgba(14, 165, 233, 0.2) !important;
    /* 1 second cycle - fades when seconds change */
    -webkit-animation: seconds-fade 1s ease-in-out infinite !important;
    animation: seconds-fade 1s ease-in-out infinite !important;
    white-space: nowrap !important;
    display: inline !important;
}

/* Date */
.header-date {
    font-size: 0.85rem !important;
    color: #94a3b8 !important;
    opacity: 1 !important;
    white-space: nowrap !important;
    display: inline-block !important;
}

/* Divider - MUST be visible */
.header-clock-divider {
    display: inline-block !important;
    width: 1px !important;
    height: 20px !important;
    background: #475569 !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
}

/* Remove any conflicting margins */
.header-clock > * {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Force visibility - override animations */
.header-greeting,
.header-time,
.header-date {
    animation-fill-mode: forwards !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Responsive - but ALWAYS horizontal */
@media (max-width: 1200px) {
    .header-clock {
        min-width: 420px !important;
        width: 420px !important;
        max-width: 420px !important;
        gap: 0.6rem !important;
    }
    
    .header-greeting {
        font-size: 0.85rem !important;
    }
    
    .header-time {
        font-size: 0.95rem !important;
    }
    
    .header-date {
        font-size: 0.8rem !important;
    }
}

@media (max-width: 900px) {
    .header-clock {
        order: 3 !important;
        width: 100% !important;
        margin-top: 0.75rem !important;
        margin-left: 0 !important;
        justify-content: flex-start !important;
        /* STILL HORIZONTAL NO MATTER WHAT */
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        min-width: 350px !important;
    }
}

/* Emergency override for any conflicting styles */
.site-header .header-clock,
header .header-clock {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
}

/* Fade animation - syncs with seconds changing (1s cycle) */
@keyframes seconds-fade {
    0% {
        opacity: 0.85;  /* Start visible */
        text-shadow: 0 0 6px rgba(14, 165, 233, 0.6),
                     0 0 12px rgba(14, 165, 233, 0.4),
                     0 0 18px rgba(14, 165, 233, 0.2);
    }
    50% {
        opacity: 1;  /* Peak brightness */
        text-shadow: 0 0 8px rgba(14, 165, 233, 0.7),
                     0 0 16px rgba(14, 165, 233, 0.5),
                     0 0 24px rgba(14, 165, 233, 0.3);
    }
    100% {
        opacity: 0.6;  /* Fade out when second changes */
        text-shadow: 0 0 4px rgba(14, 165, 233, 0.4),
                     0 0 8px rgba(14, 165, 233, 0.2);
    }
}

@-webkit-keyframes seconds-fade {
    0% {
        opacity: 0.85;
        text-shadow: 0 0 6px rgba(14, 165, 233, 0.6),
                     0 0 12px rgba(14, 165, 233, 0.4),
                     0 0 18px rgba(14, 165, 233, 0.2);
    }
    50% {
        opacity: 1;
        text-shadow: 0 0 8px rgba(14, 165, 233, 0.7),
                     0 0 16px rgba(14, 165, 233, 0.5),
                     0 0 24px rgba(14, 165, 233, 0.3);
    }
    100% {
        opacity: 0.6;
        text-shadow: 0 0 4px rgba(14, 165, 233, 0.4),
                     0 0 8px rgba(14, 165, 233, 0.2);
    }
}
