/* NoorTime Design System & Mobile Wizard Styling - Option A Upgrades */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --card-bg: rgba(30, 41, 59, 0.85);
    --card-border: rgba(255, 255, 255, 0.12);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-emerald: #10b981;
    --accent-emerald-glow: rgba(16, 185, 129, 0.3);
    --accent-gold: #f59e0b;
    --accent-indigo: #6366f1;
    --input-bg: rgba(15, 23, 42, 0.7);
    --input-border: rgba(255, 255, 255, 0.15);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-main: 0 20px 40px rgba(0, 0, 0, 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    padding-bottom: 60px;
}

/* App Header */
.app-header {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
    padding: 14px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #10b981, #047857);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 12px var(--accent-emerald-glow);
}

.brand-title h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border: 1px solid var(--card-border);
    transition: all 0.3s ease;
}

.status-badge.status-saved {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.4);
}

.status-badge.status-saving {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.4);
}

/* Sidebar Drawer (Multi-Masjid Folder Manager) */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.drawer-side {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100vh;
    background: #0f172a;
    border-right: 1px solid var(--card-border);
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
    transition: left 0.3s ease;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
}

.drawer-side.active {
    left: 0;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--card-border);
}

.drawer-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.masjid-item-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.masjid-item-card:hover {
    border-color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.1);
}

.masjid-item-card.active {
    border-color: var(--accent-emerald);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.1));
    box-shadow: 0 4px 14px var(--accent-emerald-glow);
}

.masjid-item-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
}

.masjid-item-addr {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.masjid-item-progress {
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--accent-emerald);
}

/* Split View Layout (Photo Viewer + Data Entry) */
.wizard-split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 900px) {
    .wizard-split-layout {
        grid-template-columns: 1fr;
    }
}

/* Photo Viewer Container */
.photo-viewer-wrapper {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 400px;
}

.photo-placeholder-box {
    background: rgba(15, 23, 42, 0.6);
    border: 2px dashed var(--card-border);
    border-radius: var(--radius-md);
    padding: 40px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 350px;
}

.photo-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--card-border);
}

.photo-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
}

.photo-tools {
    display: flex;
    gap: 6px;
}

.btn-tool {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--card-border);
    color: #fff;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-tool:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-tool.btn-danger {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.3);
}

.photo-canvas-area {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #090d16;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    min-height: 350px;
}

.photo-canvas-area img {
    max-width: 100%;
    max-height: 100%;
    transition: transform 0.1s ease-out;
    user-select: none;
    -webkit-user-drag: none;
}

/* Copy Yesterday Button */
.btn-copy-yesterday {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    transition: all 0.2s ease;
}

.btn-copy-yesterday:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

.btn-copy-yesterday:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Main Container */
.main-wrapper {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 16px;
}

/* Masjid Metadata Box */
.metadata-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.metadata-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    align-items: center;
}

@media (max-width: 640px) {
    .metadata-grid {
        grid-template-columns: 1fr;
    }
}

.meta-input-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
}

.meta-input:focus {
    outline: none;
    border-color: var(--accent-emerald);
    box-shadow: 0 0 0 3px var(--accent-emerald-glow);
}

/* Month Pills Scrollable Navigation */
.month-pills-wrapper {
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 20px;
    scrollbar-width: thin;
}

.month-pills-container {
    display: flex;
    gap: 8px;
    width: max-content;
}

.month-pill {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--card-border);
    border-radius: 30px;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.month-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.month-pill.active {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 14px var(--accent-emerald-glow);
}

.month-badge {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
}

.month-badge.done {
    background: #047857;
    color: #fff;
}

/* View Mode Tabs */
.view-tabs {
    display: flex;
    background: rgba(15, 23, 42, 0.8);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 20px;
    border: 1px solid var(--card-border);
}

.tab-btn {
    flex: 1;
    padding: 10px;
    text-align: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background: var(--accent-indigo);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Mobile Wizard Card */
.card-wizard {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-main);
    backdrop-filter: blur(16px);
}

.day-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.day-indicator {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.progress-bar-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    width: 0%;
    transition: width 0.3s ease;
}

/* Field Input Groups */
.field-group {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.field-group.field-active {
    border-color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.08);
    box-shadow: 0 0 0 3px var(--accent-emerald-glow);
    transform: translateY(-1px);
}

.field-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 6px;
}

.field-num {
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #fff;
}

.field-group.field-active .field-num {
    background: var(--accent-emerald);
}

.input-wrapper {
    display: flex;
    gap: 8px;
}

.field-input {
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.field-input:focus {
    outline: none;
    border-color: var(--accent-emerald);
    background: #0f172a;
}

.btn-quick-ampm {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--card-border);
    color: #fff;
    border-radius: var(--radius-sm);
    padding: 0 14px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-quick-ampm:hover {
    background: var(--accent-gold);
    color: #000;
}

/* Card Wizard Footer Controls */
.card-wizard-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--card-border);
}

/* Buttons */
.btn-pri {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px var(--accent-emerald-glow);
    transition: all 0.2s ease;
}

.btn-pri:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-emerald-glow);
}

.btn-sec {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid var(--card-border);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-sec:hover {
    background: rgba(255, 255, 255, 0.18);
}

.btn-icon {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--card-border);
    color: #fff;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
}

.btn-icon:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 0.75rem;
}

/* Spreadsheet Grid View */
.table-responsive {
    overflow-x: auto;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-main);
}

.grid-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.grid-table th {
    background: rgba(15, 23, 42, 0.95);
    padding: 12px;
    color: var(--accent-emerald);
    font-weight: 600;
    border-bottom: 1px solid var(--card-border);
    white-space: nowrap;
}

.grid-table td {
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.grid-cell-input {
    width: 100%;
    min-width: 90px;
    background: var(--input-bg);
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 6px 8px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
}

.grid-cell-input:focus {
    outline: none;
    border-color: var(--accent-emerald);
    background: #0f172a;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background: #1e293b;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    padding: 24px;
    box-shadow: var(--shadow-main);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.export-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.export-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-card:hover {
    border-color: var(--accent-emerald);
    transform: translateY(-2px);
    background: rgba(16, 185, 129, 0.1);
}

.export-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.export-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
}

.export-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Full Month PDF Print Styles */
.print-only-container {
    display: none;
}

@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    .app-header, .metadata-card, .month-pills-wrapper, .view-tabs, .progress-bar-container, #view-wizard-section, #view-table-section, .modal-overlay, .drawer-side, .drawer-overlay {
        display: none !important;
    }
    .print-only-container {
        display: block !important;
        padding: 20px;
    }
    .print-poster-header {
        text-align: center;
        margin-bottom: 20px;
        border-bottom: 2px solid #000;
        padding-bottom: 10px;
    }
    .print-masjid-title {
        font-size: 24px;
        font-weight: 800;
        text-transform: uppercase;
    }
    .print-masjid-addr {
        font-size: 14px;
        color: #444;
    }
    .print-month-title {
        font-size: 18px;
        font-weight: 700;
        margin-top: 8px;
        color: #047857;
    }
    .print-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 11px;
    }
    .print-table th, .print-table td {
        border: 1px solid #000;
        padding: 6px 8px;
        text-align: center;
    }
    .print-table th {
        background: #f1f5f9;
        font-weight: 700;
    }
}
