/* ==========================================================================
   ✦ MASJID CLOUD - MODERN PREMIUM SAAS UI (Light/Clean Theme)
   ========================================================================== */

:root {
    --primary: #059669; /* Emerald Green */
    --primary-hover: #047857;
    --secondary: #0f766e; /* Deep Teal */
    --accent: #f59e0b; /* Amber */
    
    --bg-main: #f3f4f6; /* Very light gray */
    --bg-card: #ffffff;
    --text-main: #1f2937; /* Dark slate */
    --text-muted: #6b7280; /* Medium gray */
    --border-color: #e5e7eb;
    
    --danger: #ef4444;
    --danger-hover: #dc2626;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    --transition: all 0.2s ease-in-out;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-family);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.hidden {
    display: none !important;
}

/* ================== AUTH OVERLAY ================== */
.overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
}

.auth-card {
    background: var(--bg-card);
    width: 100%;
    max-width: 400px;
    padding: 32px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-card h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--secondary);
    text-align: center;
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 24px;
}

/* ================== MAIN APP LAYOUT ================== */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* Header */
.main-header {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.header-content h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--secondary);
}

.header-content p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

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

.user-badge {
    text-align: right;
}

.user-role {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 0.5px;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

/* Tabs Navigation */
.nav-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.tab-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.tab-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
}

/* Main Content Area */
.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ================== CARDS & GRIDS ================== */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.glass-card h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
}

.donors-card::before { background: var(--secondary); }
.donations-card::before { background: var(--primary); }
.total-card::before { background: var(--accent); }
.announcements-card::before { background: #8b5cf6; }
.staff-card::before { background: #3b82f6; }

.card-icon {
    font-size: 24px;
    margin-bottom: 12px;
}

.stat-card h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 4px;
}

/* ================== FORMS & INPUTS ================== */
.crud-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-inputs.text-area-layout {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.form-inputs.text-area-layout .full-width {
    grid-column: 1 / -1;
}

.input-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-family: var(--font-family);
    color: var(--text-main);
    background: #f9fafb;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    outline: none;
    transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

/* ================== BUTTONS ================== */
.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

button {
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.primary-btn {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.primary-btn:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-md);
}

.secondary-btn {
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.secondary-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.danger-btn {
    background: var(--danger);
    color: white;
}

.danger-btn:hover {
    background: var(--danger-hover);
}

.small-btn {
    padding: 6px 12px;
    font-size: 12px;
}

.full-btn {
    width: 100%;
}

/* ================== TABLES ================== */
.table-card {
    padding: 0;
    overflow: hidden;
}

.table-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 16px;
}

.table-header h2 {
    margin: 0;
    padding: 0;
    border: none;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-bar input {
    max-width: 250px;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 14px 24px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

th {
    background: #f9fafb;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

tr {
    background: white;
    transition: var(--transition);
    cursor: pointer;
}

tr:hover {
    background: #f3f4f6;
}

tr.selected {
    background: #ecfdf5;
    border-left: 4px solid var(--primary);
}

/* ================== CALENDAR & PRAYER TIMES ================== */
.dashboard-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.prayer-grid .form-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: center;
    margin-bottom: 12px;
}

.save-timings-btn {
    margin-top: 12px;
    float: right;
}

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

#cal-month-year {
    font-size: 16px;
    font-weight: 600;
}

.day-name {
    display: inline-block;
    width: calc(100% / 7);
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    padding-bottom: 8px;
}

.days-container {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.cal-day {
    aspect-ratio: 1;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.cal-day:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.cal-day.active-donation {
    background: #ecfdf5;
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 700;
}

.cal-day.selected {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.3);
}

.cal-day.empty {
    visibility: hidden;
}

.selected-day-details {
    background: #f9fafb;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 20px;
}

.details-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.details-header strong {
    font-size: 16px;
    color: var(--primary);
}

.details-body {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-main);
    white-space: pre-line;
    max-height: 120px;
    overflow-y: auto;
}

/* ================== DASHBOARD CONTROLS ================== */
.dashboard-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.backup-actions {
    display: flex;
    gap: 10px;
}

/* ================== FOOTER ================== */
.app-footer {
    text-align: center;
    padding: 24px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.heart-icon {
    color: var(--danger);
}

.credit-link {
    color: var(--secondary);
    font-weight: 600;
    text-decoration: none;
}

.credit-link:hover {
    text-decoration: underline;
}

/* ================== RESPONSIVENESS (MOBILE FIRST APPROACH) ================== */
@media (max-width: 900px) {
    .dashboard-split {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 16px;
    }
    
    .main-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-actions-bar {
        width: 100%;
        justify-content: space-between;
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px solid var(--border-color);
    }
    
    .user-badge {
        text-align: left;
    }
    
    .table-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-bar {
        width: 100%;
        margin-top: 12px;
    }
    
    .search-bar input {
        max-width: 100%;
        width: 100%;
    }
    
    .dashboard-controls-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .backup-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .backup-actions button, .backup-actions label {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }
    
    .prayer-grid .form-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

/* ================== LANDING PAGE ================== */
.landing-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    font-family: 'Outfit', sans-serif;
}

.landing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin-bottom: 60px;
    border-bottom: 1px solid var(--border-color);
}

.landing-header .logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--secondary);
}

.landing-header .logo span {
    color: var(--primary);
}

.landing-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.landing-nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
}

.landing-nav a:hover {
    color: var(--primary);
}

.hero-section {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
    gap: 48px;
    margin-bottom: 80px;
}

.hero-content .badge {
    display: inline-block;
    background: #ecfdf5;
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 50px;
    margin-bottom: 16px;
    text-transform: uppercase;
}

.hero-content h1 {
    font-size: 48px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.15;
    margin-bottom: 20px;
}

.hero-content p {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 32px;
}

.hero-actions {
    display: flex;
    gap: 16px;
}

.hero-sec-btn {
    padding: 12px 24px;
    text-decoration: none;
}

.hero-stats-badge {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 32px !important;
}

.mini-stat {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mini-stat strong {
    font-size: 28px;
    color: var(--primary);
    min-width: 120px;
}

.mini-stat span {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
}

.features-section, .pricing-section {
    padding: 60px 0;
    border-top: 1px solid var(--border-color);
}

.section-title {
    text-align: center;
    margin-bottom: 48px;
}

.section-title h2 {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 12px;
}

.section-title p {
    color: var(--text-muted);
    font-size: 15px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}

.feature-card {
    text-align: center;
    padding: 32px !important;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.feat-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
}

.feature-card p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

.pricing-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pricing-card {
    width: 100%;
    max-width: 450px;
    padding: 40px !important;
    position: relative;
    border-color: var(--primary) !important;
    box-shadow: 0 10px 30px rgba(5, 150, 105, 0.1) !important;
}

.pricing-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 8px;
}

.pricing-header .price {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-main);
}

.pricing-header .price span {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.pricing-features {
    list-style: none;
    margin: 32px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pricing-features li {
    font-size: 14px;
    color: var(--text-main);
    font-weight: 500;
}

.pricing-btn {
    width: 100%;
    padding: 12px 0;
}

.landing-footer {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 13px;
}

.landing-footer a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
}

@media (max-width: 768px) {
    .landing-header {
        flex-direction: column;
        gap: 16px;
        margin-bottom: 40px;
    }
    .landing-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
    }
    .hero-section {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .hero-content h1 {
        font-size: 36px;
    }
}
