/* CSS Variables for Theme Colors */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

/* General Styles */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f5f7fa;
}

main {
    flex: 1;
}

/* Card Styles */
.card {
    border: none;
    border-radius: 10px;
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: var(--primary-color);
    color: white;
    border-radius: 10px 10px 0 0 !important;
    font-weight: 600;
}

/* Stat Cards for Dashboard */
.stat-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a58ca 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.stat-card.success {
    background: linear-gradient(135deg, var(--success-color) 0%, #146c43 100%);
}

.stat-card.warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #cc9a06 100%);
}

.stat-card.info {
    background: linear-gradient(135deg, var(--info-color) 0%, #0aa2c0 100%);
}

.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-card .stat-label {
    font-size: 1rem;
    opacity: 0.9;
}

.stat-card i {
    font-size: 3rem;
    opacity: 0.3;
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
}

/* Table Styles */
.table {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
}

table thead,
table.table thead,
.table thead {
    background-color: #e9ecef !important;
}

table thead th,
table.table thead th,
.table thead th {
    background-color: #e9ecef !important;
    color: #212529 !important;
    font-weight: bold !important;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
    cursor: pointer;
}

/* Button Styles */
.btn {
    border-radius: 5px;
    padding: 0.5rem 1.5rem;
    transition: box-shadow 0.3s ease;
}

.btn:hover {
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

/* Form Styles */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.input-group-text {
    background-color: var(--light-color);
    border-color: #dee2e6;
}

/* Badge Styles */
.badge {
    padding: 0.5em 0.8em;
    font-weight: 500;
}

/* Alert Styles */
.alert {
    border-radius: 10px;
    border: none;
}

/* Navigation Styles */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.3rem;
}

/* Footer Styles */
footer {
    margin-top: auto;
    border-top: 1px solid #dee2e6;
}

/* Print Styles for Receipts */
@media print {
    .navbar,
    footer,
    .no-print {
        display: none !important;
    }

    body {
        background-color: white;
        margin: 0;
        padding: 0;
    }

    .container {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }

    /* Receipt-specific print styles */
    .receipt-print-single {
        width: 148mm;
        height: 105mm;
    }

    .receipt-print-batch {
        width: 297mm;
        height: 210mm;
    }

    /* Remove page margins for receipts */
    @page {
        margin: 0;
    }

    /* Ensure colors are printed */
    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .stat-card .stat-value {
        font-size: 2rem;
    }

    .stat-card i {
        font-size: 2rem;
    }

    .table-responsive {
        font-size: 0.875rem;
    }
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-color);
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Login Page Specific Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Dashboard Chart Container */
.chart-container {
    position: relative;
    height: 300px;
    margin-top: 1rem;
}

/* Member Status Indicators */
.status-active {
    color: var(--success-color);
}

.status-inactive {
    color: var(--danger-color);
}

/* Receipt Print Layout */
.receipt-print {
    padding: 2rem;
    background: white;
}

.receipt-header {
    text-align: center;
    border-bottom: 2px solid var(--dark-color);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.receipt-footer {
    text-align: center;
    border-top: 1px solid var(--secondary-color);
    padding-top: 1rem;
    margin-top: 2rem;
}

/* ========================================
   All Columns Member View
   ======================================== */

/* Horizontal scroll container */
.table-scroll-container {
    overflow-x: auto;
    overflow-y: visible;
    position: relative;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    border-radius: 0.25rem;
}

/* Sticky positioning for first two columns */
.table-all-columns th:nth-child(1),
.table-all-columns th:nth-child(2),
.table-all-columns td:nth-child(1),
.table-all-columns td:nth-child(2) {
    position: sticky;
    background-color: white;
    z-index: 10;
}

.table-all-columns th:nth-child(1),
.table-all-columns td:nth-child(1) {
    left: 0;
    min-width: 80px;
}

.table-all-columns th:nth-child(2),
.table-all-columns td:nth-child(2) {
    left: 80px;
    min-width: 200px;
}

/* Sticky header row */
.table-all-columns thead th {
    position: sticky;
    top: 0;
    z-index: 20;
    background-color: var(--bs-primary);
    color: white;
}

/* Column width constraints */
.table-all-columns .col-narrow {
    min-width: 100px;
    max-width: 120px;
}

.table-all-columns .col-medium {
    min-width: 150px;
    max-width: 180px;
}

.table-all-columns .col-wide {
    min-width: 220px;
    max-width: 280px;
}

.table-all-columns .col-contact {
    min-width: 140px;
    max-width: 160px;
}

/* Borders for all columns */
.table-all-columns td,
.table-all-columns th {
    border-right: 1px solid #dee2e6;
    white-space: nowrap;
    padding: 0.75rem 0.5rem;
}

/* Text truncation for long content */
.text-truncate-address {
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

/* Multiple contact indicator */
.multiple-indicator {
    font-size: 0.7rem;
    cursor: help;
    margin-left: 4px;
}

/* Hover effect for sticky columns */
.table-all-columns tbody tr:hover td:nth-child(1),
.table-all-columns tbody tr:hover td:nth-child(2) {
    background-color: #f8f9fa;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .table-all-columns th:nth-child(1),
    .table-all-columns td:nth-child(1) {
        min-width: 60px;
    }

    .table-all-columns th:nth-child(2),
    .table-all-columns td:nth-child(2) {
        left: 60px;
        min-width: 150px;
    }

    .table-all-columns td,
    .table-all-columns th {
        font-size: 0.875rem;
        padding: 0.5rem 0.35rem;
    }
}

/* Print styles for all-columns view */
@media print {
    .table-scroll-container {
        overflow: visible;
    }

    .table-all-columns {
        font-size: 8pt;
    }

    .table-all-columns th,
    .table-all-columns td {
        padding: 2px 4px;
    }
}

/* ========================================
   Professional Table Styling
   ======================================== */

/* Member list table */
.table {
    font-size: 14px;
}

.table thead th {
    font-size: 13px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* Clean table without heavy styling */
.table-hover tbody tr:hover {
    background-color: #f8f9fa;
}

/* ========================================
   Larger Checkboxes for Better UX
   ======================================== */

/* Make checkboxes bigger and easier to click */
.form-check-input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Add spacing for checkbox labels */
.form-check-input[type="checkbox"] + label {
    cursor: pointer;
    margin-left: 8px;
}

/* ========================================
   Status Ball Indicators
   ======================================== */

/* Colored status balls with shadow - appears before member names */
.status-ball-shadow {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 10px;
    vertical-align: middle;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
