/* =====================================================
   CurrentTime.one - Main Stylesheet
   ===================================================== */

/* CSS Variables for Light/Dark Mode */
:root {
    --primary-color: #2196F3;
    --secondary-color: #FF9800;
    --success-color: #4CAF50;
    --danger-color: #F44336;
    --warning-color: #FFC107;
    --info-color: #00BCD4;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #e0e0e0;
    --text-primary: #212121;
    --text-secondary: #757575;
    --border-color: #e0e0e0;
    --shadow: rgba(0, 0, 0, 0.1);
    
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-digital: 'Orbitron', monospace;
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3d3d3d;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #404040;
    --shadow: rgba(0, 0, 0, 0.3);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 4px var(--shadow);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
}

.logo-icon {
    font-size: 2rem;
}

/* Navigation */
.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.main-nav a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary-color);
}


/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: 0.3s;
}

/* Theme Toggle */
.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: 0.3s;
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
}

/* Hero Section */
.hero-section {
    background: #ffffff;
    padding: 3rem 0;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 2rem;
    text-align: left;
}

.clock-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    background: #ffffff;
    padding: 2rem;
    border-radius: 16px;
}

.clock-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Analog Clock Card */
.analog-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
    font-weight: 500;
}

.clock-day {
    font-size: 0.875rem;
    color: #666;
    margin-top: 1rem;
}

.clock-time-small {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2563eb;
    margin-top: 0.25rem;
}

/* Digital Clock Card */
.digital-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
}

.greeting-text {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.greeting-text strong {
    color: #1a1a1a;
}

.greeting-subtext {
    font-size: 0.95rem;
    color: #999;
    margin-bottom: 1.5rem;
}

.flip-clock {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.flip-digit {
    background: #2a2a2a;
    color: white;
    padding: 1.5rem 1.25rem;
    border-radius: 8px;
    font-size: 3.5rem;
    font-weight: 700;
    font-family: 'Orbitron', monospace;
    min-width: 90px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.flip-separator {
    font-size: 2.5rem;
    color: #666;
    font-weight: 700;
}

.period {
    background: #2a2a2a;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    margin-left: 0.5rem;
}

.time-format-toggle {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.format-btn,
.fullscreen-btn {
    padding: 0.625rem 1.25rem;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    color: #666;
}

.format-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
}

.format-btn:hover,
.fullscreen-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.format-btn.active:hover {
    color: white;
}


/* Sections */
section {
    padding: 3rem 0;
}

.page-header {
    text-align: center;
    padding: 2rem 0;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Grids */
.cities-grid,
.countries-grid,
.tools-grid,
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

/* Cards */
.city-card,
.country-card,
.tool-card,
.article-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.city-card:hover,
.country-card:hover,
.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow);
}

.tool-card {
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    display: block;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow);
    border-color: var(--primary-color);
}

.tool-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.tool-card h3 {
    margin-bottom: 0.5rem;
}

.tool-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* City Card */
.city-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.city-header a {
    color: var(--text-primary);
    text-decoration: none;
}

.city-header a:hover {
    color: var(--primary-color);
}

.city-time {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 8px;
    text-align: center;
}

.city-time .time {
    font-family: var(--font-digital);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.city-time .date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.city-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #F57C00;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: #212121;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-secondary);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Forms */
.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Tables */
.timezones-table,
.holidays-table,
.conversion-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
}

.timezones-table th,
.holidays-table th,
.conversion-table th {
    background: var(--bg-tertiary);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.timezones-table td,
.holidays-table td,
.conversion-table td {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.timezones-table tr:hover,
.holidays-table tr:hover {
    background: var(--bg-primary);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-success {
    background: var(--success-color);
    color: white;
}

.badge-secondary {
    background: var(--text-secondary);
    color: white;
}

.badge-capital {
    background: var(--warning-color);
    color: #212121;
}

/* Calendar */
.calendar-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
}

.calendar-table th {
    background: var(--bg-tertiary);
    padding: 1rem;
    font-weight: 600;
}

.calendar-day {
    padding: 1rem;
    border: 1px solid var(--border-color);
    vertical-align: top;
    min-height: 100px;
}

.calendar-day.today {
    background: rgba(33, 150, 243, 0.1);
    border-color: var(--primary-color);
}

.calendar-day.weekend {
    background: var(--bg-tertiary);
}

.calendar-day.has-holiday {
    background: rgba(255, 152, 0, 0.1);
}

.day-number {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.holiday-marker {
    font-size: 0.75rem;
    padding: 0.25rem;
    background: var(--secondary-color);
    color: white;
    border-radius: 4px;
    margin-top: 0.25rem;
}

/* Stopwatch/Timer */
.stopwatch-container,
.timer-container,
.alarm-container {
    max-width: 600px;
    margin: 2rem auto;
    text-align: center;
}

.stopwatch-display,
.timer-display {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 3rem;
    margin: 2rem 0;
}

.stopwatch-display .time-display,
.timer-display .time-display {
    font-family: var(--font-digital);
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stopwatch-controls,
.timer-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.timer-progress {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 1rem;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s;
}

/* Breadcrumb */
.breadcrumb {
    padding: 1rem 0;
}

.breadcrumb ol {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.breadcrumb li:not(:last-child)::after {
    content: '›';
    margin-left: 0.5rem;
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Footer */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    line-height: 2;
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* Pagination */
.pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin: 2rem 0;
}

.page-link {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
}

.page-link:hover,
.page-link.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid var(--success-color);
    color: var(--success-color);
}

.alert-error {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

.alert-info {
    background: rgba(33, 150, 243, 0.1);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .main-nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .time-display {
        font-size: 2.5rem;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .cities-grid,
    .countries-grid,
    .tools-grid {
        grid-template-columns: 1fr;
    }
}

/* SEO Content */
.seo-content {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.seo-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.seo-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.seo-content ul,
.seo-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.seo-content li {
    margin-bottom: 0.5rem;
}

/* Analog Clock */
.analog-clock {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: #2a2a2a;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.analog-clock::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: linear-gradient(145deg, #ffffff, #e0e0e0);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.analog-clock::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2), transparent);
    pointer-events: none;
}

.clock-face {
    width: 100%;
    height: 100%;
    position: relative;
}

.clock-number {
    position: absolute;
    width: 100%;
    height: 100%;
    text-align: center;
    color: #e0e0e0;
    font-weight: 600;
    font-size: 0.875rem;
    font-family: Arial, sans-serif;
}

.clock-number span {
    display: inline-block;
    margin-top: 10px;
}

.clock-hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom center;
    background: white;
    border-radius: 4px;
}

.hour-hand {
    width: 6px;
    height: 50px;
    margin-left: -3px;
    background: white;
    z-index: 3;
    border-radius: 3px;
}

.minute-hand {
    width: 4px;
    height: 70px;
    margin-left: -2px;
    background: white;
    z-index: 2;
    border-radius: 2px;
}

.second-hand {
    width: 2px;
    height: 80px;
    margin-left: -1px;
    background: #FFA500;
    z-index: 4;
    border-radius: 1px;
}

/* Responsive */
@media (max-width: 1200px) {
    .clock-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .analog-card {
        order: 1;
    }
    
    .digital-card {
        order: 2;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .flip-digit {
        font-size: 2.5rem;
        min-width: 70px;
        padding: 1rem 1rem;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .clock-grid {
        padding: 1rem;
        gap: 1rem;
    }
    
    .clock-card {
        padding: 1rem;
    }
    
    .analog-clock {
        width: 150px;
        height: 150px;
    }
    
    .clock-time-small {
        font-size: 1.25rem;
    }
    
    .greeting-text {
        font-size: 1.1rem;
    }
    
    .greeting-subtext {
        font-size: 0.85rem;
    }
    
    .flip-digit {
        font-size: 1.8rem;
        min-width: 50px;
        padding: 0.75rem 0.5rem;
    }
    
    .flip-separator {
        font-size: 1.5rem;
    }
    
    .period {
        font-size: 1rem;
        padding: 0.5rem 0.75rem;
    }
    
    .format-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .analog-clock {
        width: 120px;
        height: 120px;
    }
    
    .clock-number {
        font-size: 0.7rem;
    }
    
    .hour-hand {
        width: 4px;
        height: 35px;
        margin-left: -2px;
    }
    
    .minute-hand {
        width: 3px;
        height: 50px;
        margin-left: -1.5px;
    }
    
    .second-hand {
        width: 2px;
        height: 55px;
        margin-left: -1px;
    }
    
    .flip-digit {
        font-size: 1.5rem;
        min-width: 40px;
        padding: 0.5rem 0.4rem;
    }
    
    .flip-separator {
        font-size: 1.2rem;
    }
    
    .period {
        font-size: 0.9rem;
        padding: 0.4rem 0.6rem;
    }
    
    .greeting-text {
        font-size: 1rem;
    }
    
    .time-format-toggle {
        gap: 0.5rem;
    }
    
    .format-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }
}
