:root {
    --bg-dark: #121212;
    --text-dark: #ffffff;
    --bg-light: #f8f9fa;
    --text-light: #222222;
    --accent: #e91e63;
    --card-bg-dark: rgba(255, 255, 255, 0.08);
    --card-bg-light: rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    transition: background 0.3s, color 0.3s;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.dark-mode {
    background-color: var(--bg-dark);
    color: var(--text-dark);
}

.light-mode {
    background-color: var(--bg-light);
    color: var(--text-light);
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    padding: 20px 40px;
    align-items: center;
}

.brand-box {
    background: var(--accent);
    color: white;
    padding: 10px 15px;
    font-weight: 800;
    text-decoration: none;
    font-size: 1.2rem;
    border-radius: 4px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    margin-left: 15px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.icon-btn:hover {
    opacity: 1;
}

/* Status Area */
.sync-status {
    text-align: left;
    padding: 40px 40px 0;
    max-width: 1400px;
    margin: 0 auto;
}

#sync-msg {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 5px;
}

#accuracy-info {
    font-size: 0.9rem;
    opacity: 0.6;
}

.location-context {
    margin-top: 10px;
    font-size: 0.95rem;
}

.highlight {
    border-bottom: 1px dotted;
}

/* Main Clock */
.main-clock-area {
    text-align: left;
    padding: 20px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.big-clock {
    font-size: clamp(4.5rem, 18vw, 16rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    margin-left: -5px;
}

.date-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 15px;
    margin-top: 10px;
}

.date-text {
    font-size: clamp(1.2rem, 3vw, 2.2rem);
    font-weight: 500;
    opacity: 0.8;
}

.special-day {
    font-size: 1rem;
    opacity: 0.85;
    font-weight: 600;
    color: var(--accent);
}

.sun-info {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    font-size: 0.9rem;
    opacity: 0.7;
}

.sun-info i {
    font-size: 1.1rem;
}

/* World Strip */
.world-strip {
    margin-top: 50px;
    background: rgba(128,128,128,0.05);
    padding: 20px 0;
}

.strip-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.strip-item {
    background: var(--card-bg-dark);
    padding: 12px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 130px;
    border-radius: 8px;
}

.light-mode .strip-item {
    background: var(--card-bg-light);
}

.strip-city {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.strip-time {
    font-size: 1.2rem;
    font-weight: 400;
    opacity: 0.9;
}

/* Search Modal Overlay */
.search-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    z-index: 1000;
    padding: 80px 5% 40px;
}

.search-modal.active {
    display: block;
}

.search-box {
    max-width: 900px;
    margin: 0 auto;
}

.search-header {
    display: flex;
    align-items: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.4);
    padding-bottom: 10px;
}

.search-box input {
    width: 100%;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 2rem;
    outline: none;
}

.close-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
}

.close-btn:hover {
    opacity: 1;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 30px;
    max-height: 65vh;
    overflow-y: auto;
}

.result-card {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 16px;
    border-radius: 8px;
    color: #ffffff;
}

.r-region {
    font-size: 0.75rem;
    opacity: 0.6;
    text-transform: uppercase;
}

.r-city {
    font-weight: 700;
    font-size: 1.1rem;
    margin: 4px 0;
}

.r-time {
    font-size: 1.6rem;
    font-weight: 800;
    color: #ff4081;
}

/* Info Modal */
.info-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.info-modal.active {
    display: flex;
}

.info-modal-content {
    background: var(--bg-dark);
    color: var(--text-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 550px;
    padding: 30px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.light-mode .info-modal-content {
    background: var(--bg-light);
    color: var(--text-light);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.info-modal-content .close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    color: inherit;
}

.modal-body-text {
    margin-top: 20px;
    line-height: 1.6;
    font-size: 0.95rem;
}

.modal-body-text p {
    margin-bottom: 12px;
}

.contact-email-link {
    display: inline-block;
    padding: 10px 18px;
    background: var(--accent);
    color: #ffffff !important;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    margin-top: 5px;
}

/* Footer */
footer {
    padding: 40px;
    text-align: left;
    opacity: 0.7;
    font-size: 0.85rem;
}

.footer-links a {
    color: inherit;
    text-decoration: none;
    margin-right: 15px;
    border-bottom: 1px dashed transparent;
    transition: border-color 0.2s;
}

.footer-links a:hover {
    border-color: currentColor;
}

@media (max-width: 768px) {
    header, .sync-status, .main-clock-area, footer {
        padding-left: 20px;
        padding-right: 20px;
    }
    .date-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}