:root {
    /* Updated Color Scheme - Dark Gray/Black */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f7;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --accent: #333333; /* Changed from blue to dark gray */
    --accent-hover: #555555;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    --border-color: #d2d2d7;
    --success: #34c759;
    --error: #ff3b30;
    --header-height: 56px; /* Reduced from 60px */
}

[data-theme="dark"] {
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1a6;
    --accent: #555555;
    --accent-hover: #777777;
    --card-bg: #1e1e1e;
    --card-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    --border-color: #3a3a3c;
}

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

html, body {
    width: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
    font-size: 14px;
}

body {
    font-family: 'SF Pro Display', 'Noto Sans Bengali', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Rotating Globe Icon */
.rotating-globe {
    font-size: 1.4rem;
    color: var(--accent);
    animation: rotateGlobe 8s linear infinite;
}

@keyframes rotateGlobe {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-secondary);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Header Styles */
.header {
    background-color: var(--bg-primary);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.logo {
    font-size: 1.7rem; /* Slightly reduced */
    font-weight: 800;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-family: 'SF Pro Display', sans-serif;
}

.logo span {
    background: linear-gradient(135deg, var(--accent), #555555);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Share Button */
.share-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    position: relative;
}

.share-btn:hover {
    background-color: var(--bg-secondary);
    color: var(--accent);
}

/* Share Dropdown */
.share-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 0.75rem;
    width: 200px;
    z-index: 110;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.share-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.share-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    border-radius: 8px;
}

.share-dropdown a:hover {
    background-color: var(--bg-secondary);
}

.share-dropdown a i {
    width: 20px;
    text-align: center;
    font-size: 0.9rem;
}

/* Language Selector */
.language-selector {
    position: relative;
    display: inline-block;
}

.language-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 0.8rem;
    border-radius: 20px;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    font-weight: 500;
}

.language-btn:hover {
    background-color: var(--bg-secondary);
}

.language-btn i {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.language-btn.active i {
    transform: rotate(180deg);
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    width: 200px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 110;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg-secondary);
}

.language-dropdown::-webkit-scrollbar {
    width: 6px;
}

.language-dropdown::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 0 12px 12px 0;
}

.language-dropdown::-webkit-scrollbar-thumb {
    background-color: var(--accent);
    border-radius: 3px;
}

.language-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.language-dropdown a:hover {
    background-color: var(--bg-secondary);
    color: var(--accent);
}

.language-dropdown a i {
    width: 20px;
    text-align: center;
    font-size: 0.9rem;
}

.language-code {
    font-weight: 600;
    margin-left: auto;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background-color: var(--bg-secondary);
}

/* Menu Button */
.menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.menu-btn__line {
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.menu-btn.open .menu-btn__line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-btn.open .menu-btn__line:nth-child(2) {
    opacity: 0;
}

.menu-btn.open .menu-btn__line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: var(--header-height);
    right: -100%;
    width: 260px;
    height: calc(100vh - var(--header-height));
    background-color: var(--bg-primary);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 99;
    overflow-y: auto;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu ul {
    list-style: none;
    padding: 1.25rem 0;
}

.mobile-menu li {
    border-bottom: 1px solid var(--border-color);
}

.mobile-menu a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.mobile-menu a:hover {
    background-color: var(--bg-secondary);
}

.mobile-menu a i {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
}

/* Main Content */
.main {
    flex: 1;
    padding-top: calc(var(--header-height) + 1.5rem);
    padding-bottom: 1.5rem;
}

.article-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

article {
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 1.25rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    border: 1px solid var(--border-color);
}

article.visible {
    opacity: 1;
    transform: translateY(0);
}

article.highlight {
    animation: highlight 1.5s ease;
}

@keyframes highlight {
    0% { box-shadow: 0 0 0 0 rgba(51, 51, 51, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(51, 51, 51, 0); }
    100% { box-shadow: 0 0 0 0 rgba(51, 51, 51, 0); }
}

.article-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.article-header i {
    font-size: 1.1rem;
}

.article-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.article-content {
    color: var(--text-primary);
    font-size: 0.9rem;
}

/* Current Time Styles */
.current-time-display {
    text-align: center;
    margin-bottom: 1rem;
}

#current-clock {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    line-height: 1;
}

#current-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.location-selector {
    width: 100%;
}

.location-selector select {
    width: 100%;
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.location-selector select:hover {
    border-color: var(--accent);
}

.location-selector select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(51, 51, 51, 0.1);
}

/* Next Prayer Styles */
.next-prayer-info {
    text-align: center;
}

#next-prayer-info {
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
}

#time-remaining {
    font-size: 1.7rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--accent);
}

#next-prayer-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Sun Times Styles */
.sun-times {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
}

.sun-time {
    text-align: center;
    flex: 1;
}

.sun-time h3 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--text-secondary);
}

.sun-time h3 i {
    color: var(--accent);
    font-size: 0.9rem;
}

.sun-time-value {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Prayer Times Table Styles */
.prayer-times-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.prayer-times-table th {
    text-align: left;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-secondary);
}

.prayer-times-table td {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-color);
}

.prayer-times-table tr:last-child td {
    border-bottom: none;
}

.prayer-times-table tr.current-prayer td {
    color: var(--accent);
    font-weight: 600;
}

/* Hadith Styles */
.hadith-content {
    text-align: center;
}

.hadith-arabic {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    line-height: 1.6;
    color: var(--accent);
}

.hadith-bengali {
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    line-height: 1.5;
}

.hadith-source {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 2px solid var(--text-secondary);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
    margin-left: 5px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer Styles */
.footer {
    background-color: var(--bg-secondary);
    padding: 2rem 0 1rem;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.footer-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.6rem;
}

.footer-links a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 0.85rem;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-links a i {
    width: 18px;
    text-align: center;
    font-size: 0.85rem;
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.8rem;
}

.social-links {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.social-link:hover {
    background-color: var(--accent);
    color: white;
    transform: translateY(-2px);
}

.copyright {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Copy Link Notification */
.copy-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--success);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 0.9rem;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.copy-notification.show {
    opacity: 1;
}

/* Error Message */
.error-message {
    color: var(--error);
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .header {
        padding: 0 1.25rem;
    }

    .menu-btn {
        display: flex;
    }

    .header-controls {
        gap: 0.8rem;
    }

    .article-container {
        padding: 0 1.25rem;
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0 1rem;
    }

    .article-container {
        padding: 0 1rem;
    }

    #current-clock {
        font-size: 1.7rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .header, .footer, .share-container, .language-selector, .theme-toggle, .menu-btn {
        display: none !important;
    }

    .main {
        padding-top: 0;
    }

    article {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }

    .article-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}