/* ===== CSS Custom Properties for Theming ===== */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-header: rgba(255, 255, 255, 0.97);
    --bg-sidebar: rgba(255, 255, 255, 0.97);
    --bg-card: #ffffff;
    --bg-modal: #ffffff;

    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --text-muted: #7f8c8d;

    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --shadow-hover: rgba(0, 0, 0, 0.15);
    --overlay-bg: rgba(0, 0, 0, 0.75);

    --accent-color: #2c3e50;
    --accent-hover: #1a252f;
    --menu-active-bg: #2c3e50;
    --menu-hover-bg: #34495e;
}

[data-theme="dark"] {
    --bg-primary: #0f0f14;
    --bg-secondary: #16161d;
    --bg-header: rgba(15, 15, 20, 0.97);
    --bg-sidebar: rgba(20, 20, 28, 0.97);
    --bg-card: #1c1c26;
    --bg-modal: #1c1c26;

    --text-primary: #d4d4d8;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    --border-color: #27272a;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.5);
    --overlay-bg: rgba(0, 0, 0, 0.85);

    --accent-color: #a1a1aa;
    --accent-hover: #d4d4d8;
    --menu-active-bg: #27272a;
    --menu-hover-bg: #27272a;
}

/* ===== Reset ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== Base ===== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== Header ===== */
.header {
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 4px var(--shadow-color);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}


.header-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

/* ===== Header Buttons ===== */
.header-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-primary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 34px;
}

.header-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--text-muted);
}

/* ===== Layout ===== */
.container {
    display: flex;
    height: calc(100vh - 62px);
    position: relative;
}

/* ===== Sidebar ===== */
.sidebar {
    width: 250px;
    background: var(--bg-sidebar);
    backdrop-filter: blur(12px);
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: 1px 0 4px var(--shadow-color);
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sidebar.closed {
    transform: translateX(-100%);
    position: absolute;
    height: 100%;
    z-index: 50;
}

.sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.close-sidebar {
    font-size: 18px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.close-sidebar:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.menu-section {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.menu-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.menu-item {
    padding: 10px 14px;
    margin: 3px 0;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    color: var(--text-primary);
    font-size: 14px;
}

.menu-item:hover {
    background: var(--menu-hover-bg);
    color: #ffffff;
}

.menu-item.active {
    background: var(--menu-active-bg);
    color: #ffffff;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    overflow-y: auto;
}

.content-area {
    padding: 40px 24px 24px;
    max-width: 900px;
    margin: 0 auto;
}

/* ===== Welcome Message ===== */
.welcome-message {
    text-align: center;
    margin-top: 80px;
    color: var(--text-primary);
}

.welcome-message h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.welcome-message p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.welcome-hint {
    font-size: 14px !important;
    color: var(--text-muted) !important;
    margin-top: 8px !important;
}

/* ===== Images ===== */
.images-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.page-image {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px var(--shadow-color);
    display: none;
}

.content-heading {
    text-align: center;
    margin-bottom: 24px;
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== Not Available ===== */
.not-available {
    text-align: center;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 40px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.not-available h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.not-available p {
    font-size: 14px;
    margin-bottom: 8px;
}

/* ===== Dua Grid ===== */
.dua-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 16px 0;
}

.dua-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.dua-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px var(--shadow-hover);
}

.dua-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 12px;
}

.dua-card .title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    z-index: 1000;
    padding: 20px;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--bg-modal);
    padding: 24px;
    border-radius: 10px;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    position: relative;
    text-align: center;
    border: 1px solid var(--border-color);
}

.modal-content h3 {
    color: var(--text-primary);
    margin-bottom: 16px;
}

.close-modal {
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 22px;
    cursor: pointer;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    transition: background 0.2s ease;
}

.close-modal:hover {
    background: rgba(0, 0, 0, 0.6);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header-left {
        min-width: 0;
    }

    .header-title {
        font-size: 18px;
    }

    .sidebar {
        position: absolute;
        height: 100%;
        z-index: 50;
    }

    .content-area {
        padding: 24px 16px;
    }

    .welcome-message {
        margin-top: 40px;
    }

    .welcome-message h2 {
        font-size: 22px;
    }

    .dua-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 10px 12px;
    }

    .header-right {
        gap: 4px;
    }

    .header-btn {
        min-width: 32px;
        height: 30px;
        font-size: 14px;
        padding: 4px 8px;
    }

}
