/* time.enhost.uk - page-specific styles */

body {
    max-width: 800px;
}

header {
    margin-bottom: 40px;
}

h1 {
    margin-bottom: 5px;
}

.info-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.info-section p {
    margin-bottom: 10px;
    font-size: 14px;
}

.info-section code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'IBM Plex Mono', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    display: inline-block;
}

.info-section pre {
    background: #f4f4f4;
    padding: 15px;
    border-radius: 3px;
    overflow-x: auto;
    margin: 10px 0;
}

.info-section pre code {
    padding: 0;
    background: none;
    display: block;
}

.copy-icon {
    font-size: 24px;
    color: #666;
    transition: color 0.2s;
}

.copy-icon.copied {
    color: #2e7d32;
}

.time-section {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
}

.time-label {
    font-size: 12px;
    /* Carried by an h1, so the heading weight has to be overridden */
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    margin-bottom: 8px;
}

.time-value {
    font-family: 'IBM Plex Mono', 'Monaco', 'Courier New', monospace;
    font-size: 90px;
    font-weight: 400;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    user-select: none;
}

.time-value:hover .copy-icon {
    color: #0066cc;
}

.unix-time {
    font-family: 'IBM Plex Mono', 'Monaco', 'Courier New', monospace;
    font-size: 16px;
    color: #666;
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.unix-time .copy-icon {
    font-size: 16px;
}

/* Timezone picker above the clock */
.tz-picker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.tz-picker label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
}

.tz-picker select {
    padding: 8px 12px;
    font-size: 14px;
    font-family: 'IBM Plex Sans', sans-serif;
    color: #333;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    max-width: 260px;
}

.tz-picker select:hover {
    border-color: #0066cc;
}

.tz-offset {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: #999;
}

/* The next daylight-saving change; takes the full width so it sits on its own
   line under the picker rather than stretching the row */
.dst-note {
    flex-basis: 100%;
    text-align: center;
    font-size: 12px;
    color: #999;
}

/* Secondary action, matching the other tools */
.share-btn {
    padding: 8px 14px;
    font-size: 13px;
    font-family: 'IBM Plex Sans', sans-serif;
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.share-btn:hover {
    background: #f5f5f5;
    border-color: #0066cc;
    color: #0066cc;
}

.share-btn.copied {
    border-color: #2e7d32;
    color: #2e7d32;
}

/* Unix, .beat and decimal time share one row below the main clock */
.readings {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: 10px;
}

.reading {
    font-family: 'IBM Plex Mono', 'Monaco', 'Courier New', monospace;
    font-size: 16px;
    color: #666;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.reading:hover {
    color: #333;
}

.reading .copy-icon {
    font-size: 14px;
}


.time-value-small {
    font-family: 'IBM Plex Mono', 'Monaco', 'Courier New', monospace;
    font-size: 32px;
    margin-bottom: 20px;
    font-weight: 400;
}

.time-value .ms, .time-value-small .ms {
    font-size: 0.8em;
}

.offset-info {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

.offset-value {
    font-weight: 600;
    color: #333;
    transition: color 0.3s;
}

.offset-value.good {
    color: #2e7d32;
}

.offset-value.warning {
    color: #f57c00;
}

.offset-value.bad {
    color: #d32f2f;
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.comparison-item {
    text-align: center;
}

.time-label-small {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    font-weight: 500;
}

.offset-info-small {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
}

.stats {
    font-size: 12px;
    color: #999;
    margin-top: 15px;
}

.timer-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.timer-btn {
    background: #0066cc;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-family: 'IBM Plex Sans', sans-serif;
    transition: background 0.2s;
}

.timer-btn:hover {
    background: #0052a3;
}

.timer-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.timer-display {
    font-family: 'IBM Plex Mono', 'Monaco', 'Courier New', monospace;
    font-size: 16px;
    color: #333;
    margin-top: 5px;
    transition: font-size 0.3s;
}

.timer-display.active {
    font-size: 48px;
    margin-top: 15px;
}

.upstream-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.upstream-list li {
    padding: 5px 0;
    font-size: 14px;
    color: #666;
}

.upstream-list a {
    color: #0066cc;
    text-decoration: none;
}

.upstream-list a:hover {
    text-decoration: underline;
}

.status {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
}

.status.error {
    color: #d32f2f;
}

/* Snapshot values and rollover dates, as a responsive grid of small tiles */
.scale-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.scale {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 12px 14px;
}

.scale-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    margin-bottom: 4px;
}

.scale-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 16px;
    color: #333;
    word-break: break-all;
}

.scale-note {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

/* Definitions behind the "what each of these is" toggle */
.scale-notes {
    margin-top: 15px;
}

.scale-notes dt {
    font-weight: 600;
    font-size: 14px;
    margin-top: 12px;
}

.scale-notes dd {
    margin: 4px 0 0;
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

/* Collapsed leap-second history */
.leap-table summary {
    cursor: pointer;
    font-size: 14px;
    color: #0066cc;
    margin-top: 15px;
    width: fit-content;
}

.leap-table summary:hover {
    text-decoration: underline;
}

.leap-table table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 15px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
}

.leap-table th,
.leap-table td {
    text-align: left;
    padding: 6px 10px;
    border-bottom: 1px solid #f0f0f0;
}

.leap-table th {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    border-bottom: 1px solid #e0e0e0;
}

.leap-table tbody tr:last-child td {
    border-bottom: none;
    font-weight: 500;
}

/* Rollovers that have not happened yet */
.leap-table tr.future td {
    color: #999;
}

.leap-note {
    margin-top: 10px;
    font-size: 12px;
    color: #999;
}

/* Closing caveat, after the content rather than interrupting it */
.accuracy-note {
    font-size: 13px;
    color: #999;
    line-height: 1.6;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

@media (max-width: 600px) {
    .leap-table table {
        font-size: 11px;
    }

    .leap-table th,
    .leap-table td {
        padding: 5px 6px;
    }

    .info-section pre {
        padding: 10px;
        font-size: 11px;
    }
    
    .copy-icon {
        font-size: 20px;
    }
    
    .comparison-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .time-value {
        font-size: 64px;
        flex-direction: column;
        gap: 10px;
    }
    
    .unix-time {
        font-size: 14px;
        flex-direction: column;
        gap: 5px;
    }
    
    .unix-time .copy-icon {
        font-size: 14px;
    }
    
    .time-value-small {
        font-size: 24px;
    }
    
    .time-section {
        padding: 20px;
    }
}
