/* ========================================
   MATMI SANGHAT DONATION PORTAL
   Islamic Theme - Green/Black Color Scheme
   Responsive Design - Mobile First
   ======================================== */

/* CSS Variables - Theme Colors */
:root {
    /* Primary Colors */
    --primary-green: #006400;
    --primary-green-dark: #004d00;
    --primary-green-light: #2e7d32;
    --secondary-green: #1b5e20;
    
    /* Accent Colors */
    --gold: #d4af37;
    --gold-light: #f4e4a1;
    
    /* Neutral Colors */
    --dark: #0f1115;
    --dark-light: #1a1d23;
    --gray: #6c757d;
    --light: #f8f9fa;
    --white: #ffffff;
    
    /* Status Colors */
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    
    /* Shadows & Borders */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 25px rgba(0,0,0,0.2);
    --border-radius: 8px;
    --border-radius-lg: 12px;
    
    /* Typography */
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-urdu: 'Noto Nastaliq Urdu', 'Arial', sans-serif;
}

/* Base Reset & Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
    direction: ltr;
}

/* Urdu Text Support */
.urdu-text {
    font-family: var(--font-urdu);
    line-height: 2;
}

/* Container Utility */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.site-header {
    background: linear-gradient(135deg, var(--dark) 0%, var(--primary-green-dark) 100%);
    color: var(--white);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
    border-bottom: 3px solid var(--gold);
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

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

.logo i {
    font-size: 2rem;
    color: var(--gold);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--white);
}

.logo small {
    display: block;
    font-size: 0.85rem;
    color: var(--gold-light);
    opacity: 0.9;
}

/* Buttons */
.btn-admin, .btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.btn-admin {
    background: var(--gold);
    color: var(--dark);
}

.btn-admin:hover {
    background: var(--gold-light);
    transform: translateY(-2px);
}

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

.btn-primary:hover {
    background: var(--secondary-green);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-green);
    border: 2px solid var(--primary-green);
}

.btn-secondary:hover {
    background: var(--primary-green);
    color: var(--white);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Public Page Styles */
.public-page {
    padding: 30px 0;
}

.section-title {
    text-align: center;
    margin: 30px 0 20px;
    color: var(--primary-green);
    font-size: 1.8rem;
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--gold);
    border-radius: 2px;
}

/* Video Section */
.video-container {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-lg);
    margin: 20px 0;
    text-align: center;
}

.video-container video {
    width: 100%;
    max-width: 900px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    background: #000;
}

.video-note {
    margin-top: 15px;
    padding: 10px;
    background: #fff3cd;
    border-left: 4px solid var(--warning);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-size: 0.9rem;
    color: #856404;
}

/* Ads Section */
.ads-section {
    background: var(--white);
    padding: 30px 0;
    margin: 30px 0;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
}

.ads-title {
    text-align: center;
    color: var(--primary-green);
    margin-bottom: 25px;
    font-size: 1.5rem;
}

.ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.ad-slot {
    background: #f8f9fa;
    border: 2px dashed #ced4da;
    border-radius: var(--border-radius);
    padding: 15px;
    text-align: center;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.ad-slot.leaderboard { grid-column: 1 / -1; min-height: 100px; }
.ad-slot.medium-rect { min-height: 260px; }
.ad-slot.banner { min-height: 70px; }

.ad-label {
    display: block;
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 8px;
    font-weight: 500;
}

.ad-placeholder {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    padding: 20px;
    border-radius: var(--border-radius);
    color: var(--gray);
    font-weight: 500;
}

/* Info Cards */
.info-section {
    padding: 20px 0 40px;
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.info-card {
    background: var(--white);
    padding: 25px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    border-top: 4px solid var(--primary-green);
    transition: transform 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
}

.info-card i {
    font-size: 2rem;
    color: var(--primary-green);
    margin-bottom: 15px;
}

.info-card h4 {
    margin: 0 0 12px 0;
    color: var(--dark);
    font-size: 1.2rem;
}

.info-card p {
    margin: 8px 0;
    color: var(--gray);
    font-size: 0.95rem;
}

/* Footer */
.site-footer, .dashboard-footer {
    background: var(--dark);
    color: var(--white);
    text-align: center;
    padding: 25px 0;
    margin-top: 40px;
}

.site-footer p, .dashboard-footer p {
    margin: 5px 0;
    opacity: 0.9;
}

.domain {
    font-weight: 600;
    color: var(--gold);
    margin-top: 8px !important;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: modalSlide 0.3s ease;
}

.modal-content.modal-lg {
    max-width: 600px;
}

@keyframes modalSlide {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--gray);
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--danger);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    color: var(--white);
    padding: 20px 25px;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-header i {
    font-size: 1.5rem;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.modal-content form {
    padding: 25px;
}

.modal-note {
    text-align: center;
    padding: 15px 25px 25px;
    color: var(--gray);
    font-size: 0.85rem;
    border-top: 1px solid #eee;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.3s;
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(0,100,0,0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.error-msg {
    color: var(--danger);
    font-size: 0.9rem;
    margin: 10px 0;
    min-height: 20px;
}

/* Dashboard Layout */
.dashboard-body {
    display: flex;
    min-height: 100vh;
    background: #f0f4f1;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--dark) 0%, var(--primary-green-dark) 100%);
    color: var(--white);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar .logo {
    text-align: center;
}

.sidebar .logo h3 {
    margin: 10px 0 3px;
    font-size: 1.3rem;
    color: var(--white);
}

.sidebar .logo small {
    color: var(--gold-light);
    font-size: 0.85rem;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-link {
    width: 100%;
    padding: 14px 25px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.85);
    text-align: left;
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    border-left: 4px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255,255,255,0.1);
    color: var(--white);
    border-left-color: var(--gold);
}

.nav-link i {
    width: 20px;
    text-align: center;
}

.nav-link.logout {
    margin-top: 20px;
    color: #ff8a8a;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 18px;
}

.nav-link.logout:hover {
    background: rgba(220,53,69,0.2);
    color: var(--white);
    border-left-color: var(--danger);
}

/* Main Content */
.dashboard-main {
    flex: 1;
    margin-left: 260px;
    padding: 25px;
    min-height: 100vh;
}

.panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.panel.active {
    display: block;
}

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

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.panel-header h2 {
    color: var(--primary-green);
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-filter, .table-controls, .report-actions, .summary-filters, .date-range {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.date-filter select,
.table-controls input,
.table-controls select,
.summary-filters select,
.date-range input {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    min-width: 150px;
}

/* Dashboard Cards */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 15px;
    border-top: 4px solid var(--primary-green);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-3px);
}

.card.card-in { border-top-color: var(--success); }
.card.card-out { border-top-color: var(--danger); }
.card.card-balance { border-top-color: var(--gold); }
.card.card-count { border-top-color: var(--info); }

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--white);
}

.card-in .card-icon { background: var(--success); }
.card-out .card-icon { background: var(--danger); }
.card-balance .card-icon { background: var(--gold); }
.card-count .card-icon { background: var(--info); }

.card-content h4 {
    font-size: 0.95rem;
    color: var(--gray);
    margin: 0 0 5px 0;
    font-weight: 500;
}

.card-content .amount {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
    line-height: 1.2;
}

.card-content small {
    color: var(--gray);
    font-size: 0.8rem;
}

/* Quick Stats */
.quick-stats {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-top: 10px;
}

.quick-stats h3 {
    margin: 0 0 15px 0;
    color: var(--primary-green);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.stat-item {
    text-align: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: var(--border-radius);
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 5px;
}

.stat-value {
    font-weight: 600;
    color: var(--dark);
    font-size: 1.1rem;
}

/* Form Card */
.form-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 25px;
    box-shadow: var(--shadow);
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

thead {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    color: var(--white);
}

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
}

tbody tr:hover {
    background: #f8f9fa;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.badge-IN {
    background: rgba(40,167,69,0.15);
    color: var(--success);
}

.badge-OUT {
    background: rgba(220,53,69,0.15);
    color: var(--danger);
}

/* Action Buttons */
.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
    margin-right: 5px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.action-btn.edit {
    background: var(--info);
    color: white;
}

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

.action-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.no-data {
    text-align: center;
    padding: 40px;
    color: var(--gray);
    font-style: italic;
    display: none;
}

.no-data.show {
    display: block;
}

/* Chart Section */
.chart-section {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 25px;
    box-shadow: var(--shadow);
    margin-bottom: 25px;
}

.chart-section h3 {
    margin: 0 0 20px 0;
    color: var(--primary-green);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-container {
    position: relative;
    height: 350px;
    max-width: 800px;
    margin: 0 auto;
}

/* Monthly Summary */
.monthly-summary, .date-report {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 25px;
    box-shadow: var(--shadow);
    margin-bottom: 25px;
}

.monthly-summary h3, .date-report h3 {
    margin: 0 0 20px 0;
    color: var(--primary-green);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.summary-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-green);
}

.summary-item .month {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
}

.summary-item .stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.summary-item .in { color: var(--success); }
.summary-item .out { color: var(--danger); }

/* Date Report */
.date-range {
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.date-range input {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
}

.date-range span {
    margin: 0 10px;
    color: var(--gray);
}

.report-result {
    background: #f8f9fa;
    padding: 20px;
    border-radius: var(--border-radius);
    min-height: 100px;
}

/* Print Styles */
@media print {
    .sidebar, .panel-header, .table-controls, .report-actions, .no-print {
        display: none !important;
    }
    
    .dashboard-main {
        margin-left: 0;
        padding: 0;
    }
    
    .panel {
        display: block !important;
    }
    
    .card, .form-card, .table-responsive {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .date-filter, .table-controls {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
        overflow: visible;
    }
    
    .sidebar .logo h3,
    .sidebar .logo small,
    .nav-link span {
        display: none;
    }
    
    .nav-link {
        justify-content: center;
        padding: 15px;
    }
    
    .nav-link i {
        font-size: 1.2rem;
        margin: 0;
    }
    
    .dashboard-main {
        margin-left: 70px;
        padding: 15px;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .header-flex {
        flex-direction: column;
        text-align: center;
    }
    
    .ads-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    table {
        font-size: 0.85rem;
    }
    
    th, td {
        padding: 10px 12px;
    }
    
    .action-btn {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .logo h1 {
        font-size: 1.3rem;
    }
    
    .logo small {
        font-size: 0.8rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .btn-admin, .btn-primary {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    .modal-content {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 0.95rem;
    }
    
    .card {
        flex-direction: column;
        text-align: center;
    }
    
    .card-icon {
        margin-bottom: 10px;
    }
    
    .chart-container {
        height: 280px;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.hidden { display: none !important; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.font-bold { font-weight: 700; }