/**
 * CHONGAHBDA ASSOCIATION - Main Stylesheet
 * Traditional Association Management System
 * Theme: Brown/Tan background with Black text and Green accents
 */

/* =============================================
   CSS VARIABLES & THEME CONFIGURATION
   ============================================= */
:root {
    --primary-color: #8B4513;      /* Brown */
    --secondary-color: #D2B48C;    /* Tan */
    --accent-color: #228B22;       /* Green */
    --text-color: #000000;         /* Black */
    --text-light: #333333;         /* Light black */
    --text-muted: #666666;         /* Muted text */
    --white: #FFFFFF;
    --gray-light: #f8f9fa;
    --gray-medium: #e9ecef;
    --gray-dark: #6c757d;
    --danger: #dc3545;
    --warning: #ffc107;
    --success: #28a745;
    --info: #17a2b8;
    
    --border-radius: 5px;
    --box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
    
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-size-base: 14px;
    --line-height-base: 1.5;
}

/* =============================================
   DARK MODE VARIABLES
   ============================================= */
[data-theme="dark"] {
    --primary-color: #A0522D;
    --secondary-color: #8B7355;
    --text-color: #FFFFFF;
    --text-light: #F0F0F0;
    --text-muted: #CCCCCC;
    --white: #1a1a1a;
    --gray-light: #2d2d2d;
    --gray-medium: #404040;
    --gray-dark: #B0B0B0;
}

/* =============================================
   BASE STYLES
   ============================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--text-color);
    background-color: var(--secondary-color);
    background-image: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 35px,
            rgba(139, 69, 19, 0.05) 35px,
            rgba(139, 69, 19, 0.05) 70px
        );
}

/* =============================================
   TYPOGRAPHY
   ============================================= */
h1, h2, h3, h4, h5, h6 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* =============================================
   LAYOUT COMPONENTS
   ============================================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col {
    flex: 1;
    padding: 0 15px;
}

.col-1 { flex: 0 0 8.333333%; }
.col-2 { flex: 0 0 16.666667%; }
.col-3 { flex: 0 0 25%; }
.col-4 { flex: 0 0 33.333333%; }
.col-5 { flex: 0 0 41.666667%; }
.col-6 { flex: 0 0 50%; }
.col-7 { flex: 0 0 58.333333%; }
.col-8 { flex: 0 0 66.666667%; }
.col-9 { flex: 0 0 75%; }
.col-10 { flex: 0 0 83.333333%; }
.col-11 { flex: 0 0 91.666667%; }
.col-12 { flex: 0 0 100%; }

/* =============================================
   HEADER & NAVIGATION
   ============================================= */
.header {
    background: var(--primary-color);
    color: var(--white);
    padding: 1rem 0;
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--white);
    text-decoration: none;
}

.logo img {
    height: 40px;
    width: auto;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    color: var(--white);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-menu a:hover {
    background: rgba(255,255,255,0.1);
    text-decoration: none;
}

.nav-menu .active {
    background: var(--accent-color);
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
    background: var(--white);
    width: 250px;
    min-height: calc(100vh - 70px);
    box-shadow: var(--box-shadow);
    position: fixed;
    left: 0;
    top: 70px;
    z-index: 999;
    transition: var(--transition);
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar-header {
    padding: 1rem;
    background: var(--primary-color);
    color: var(--white);
    text-align: center;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
}

.sidebar-menu li {
    border-bottom: 1px solid var(--gray-medium);
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 1rem;
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

.sidebar-menu a:hover {
    background: var(--gray-light);
    color: var(--primary-color);
    text-decoration: none;
}

.sidebar-menu a.active {
    background: var(--accent-color);
    color: var(--white);
}

.sidebar-menu .icon {
    width: 20px;
    margin-right: 10px;
    text-align: center;
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.main-content {
    margin-left: 250px;
    padding: 2rem;
    min-height: calc(100vh - 70px);
    transition: var(--transition);
}

.main-content.expanded {
    margin-left: 70px;
}

/* =============================================
   CARDS
   ============================================= */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
    overflow: hidden;
}

.card-header {
    background: var(--primary-color);
    color: var(--white);
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background: var(--gray-light);
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-medium);
}

/* =============================================
   FORMS
   ============================================= */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--gray-medium);
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    transition: var(--transition);
    background: var(--white);
    color: var(--text-color);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

.form-control:disabled {
    background: var(--gray-light);
    cursor: not-allowed;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    cursor: pointer;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1.5;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

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

.btn-primary:hover {
    background: #6B3410;
    color: var(--white);
}

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

.btn-success:hover {
    background: #218838;
    color: var(--white);
}

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

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

.btn-warning {
    background: var(--warning);
    color: var(--text-color);
}

.btn-warning:hover {
    background: #e0a800;
    color: var(--text-color);
}

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

.btn-info:hover {
    background: #138496;
    color: var(--white);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* =============================================
   ALERTS
   ============================================= */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left-color: var(--success);
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left-color: var(--danger);
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left-color: var(--warning);
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: var(--info);
}

/* =============================================
   TABLES
   ============================================= */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-medium);
}

.table th {
    background: var(--gray-light);
    font-weight: 600;
    color: var(--text-color);
}

.table tbody tr:hover {
    background: var(--gray-light);
}

.table-responsive {
    overflow-x: auto;
}

/* =============================================
   BADGES
   ============================================= */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
}

.badge-success {
    background: var(--success);
    color: var(--white);
}

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

.badge-warning {
    background: var(--warning);
    color: var(--text-color);
}

.badge-info {
    background: var(--info);
    color: var(--white);
}

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

/* =============================================
   MODALS
   ============================================= */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1050;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-dialog {
    background: var(--white);
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1rem 1.5rem;
    background: var(--primary-color);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    background: var(--gray-light);
    border-top: 1px solid var(--gray-medium);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

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

/* =============================================
   LOADING & SPINNERS
   ============================================= */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--gray-light);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* =============================================
   DARK MODE TOGGLE
   ============================================= */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    box-shadow: var(--box-shadow);
    z-index: 1001;
    transition: var(--transition);
}

.theme-toggle:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

/* =============================================
   RESPONSIVE DESIGN
   ============================================= */
@media (max-width: 768px) {
    .nav-menu {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .row {
        margin: 0;
    }
    
    .col {
        padding: 0 10px;
    }
    
    .col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
    .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
        flex: 0 0 100%;
    }
    
    .modal-dialog {
        width: 95%;
        margin: 1rem;
    }
    
    .theme-toggle {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
}

/* =============================================
   UTILITY CLASSES
   ============================================= */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }

.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.rounded { border-radius: var(--border-radius); }
.shadow { box-shadow: var(--box-shadow); }

/* =============================================
   COMPONENT SPECIFIC STYLES
   ============================================= */

/* Dashboard Stats Cards */
.stats-card {
    text-align: center;
    padding: 2rem 1rem;
}

.stats-card .stats-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stats-card .stats-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
}

/* Contribution Grid */
.contribution-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 5px;
    margin-top: 1rem;
}

.contribution-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.contribution-cell.paid {
    background: var(--success);
    color: var(--white);
}

.contribution-cell.unpaid {
    background: var(--danger);
    color: var(--white);
}

.contribution-cell:hover {
    transform: scale(1.1);
}

/* Language Toggle */
.language-toggle {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.language-toggle button {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--gray-medium);
    background: var(--white);
    color: var(--text-light);
    border-radius: 3px;
    cursor: pointer;
    transition: var(--transition);
}

.language-toggle button.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* Print Styles */
@media print {
    .sidebar,
    .theme-toggle,
    .btn,
    .modal {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    body {
        background: white !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}
