/* Admin Interface Styles - Lions Club Branded Design */

/* Base Lions Club Variables matching occasion.html */
:root {
    /* Lions Club Color Scheme */
    --primary: #1565C0; /* Lions Blue */
    --primary-dark: #0D47A1;
    --secondary: #6c757d;
    --success: #2e7d32; /* Forest Green */
    --warning: #f57c00; /* Orange */
    --danger: #d32f2f; /* Red */
    --lions-yellow: #f9c910; /* Official Lions Yellow */
    --lions-yellow-dark: #e6b800;
    --dark: #2c3e50;
    --light: #ecf0f1;
    --white: #ffffff;
    --background: #f8f9fa;
    --text: #212529;
    --text-secondary: #6c757d;
    --border: #dee2e6;
    --border-accent: var(--lions-yellow);
    --shadow: 0 2px 8px rgba(21, 101, 192, 0.08);
    --shadow-lg: 0 8px 24px rgba(21, 101, 192, 0.12);
    --shadow-yellow: 0 4px 15px rgba(249, 201, 16, 0.2);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 40px); /* Ensure container takes full viewport height minus padding */
    display: flex;
    flex-direction: column;
}

#admin-interface {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.view {
    flex: 1; /* Allow views to expand to fill available space */
    min-height: 400px; /* Minimum height for content */
    display: none; /* Hidden by default */
}

.view.active {
    display: block; /* Show when active */
}

.header {
    background: var(--dark);
    color: var(--white);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 4px solid var(--lions-yellow);
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 2rem;
    margin: 0;
}

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

.btn {
    background: var(--primary);
    color: var(--white);
    border: 2px solid var(--primary);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.btn:hover {
    background: var(--lions-yellow);
    color: var(--primary);
    border-color: var(--lions-yellow);
    box-shadow: var(--shadow-yellow);
    transform: translateY(-1px);
}

.btn.secondary {
    background: var(--secondary);
    border-color: var(--secondary);
}

.btn.secondary:hover {
    background: var(--lions-yellow);
    color: var(--primary);
    border-color: var(--lions-yellow);
}

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

.btn.success:hover {
    background: var(--lions-yellow);
    color: var(--success);
    border-color: var(--lions-yellow);
}

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

.btn.warning:hover {
    background: var(--lions-yellow);
    color: var(--warning);
    border-color: var(--lions-yellow);
}

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

.btn.danger:hover {
    background: var(--lions-yellow);
    color: var(--danger);
    border-color: var(--lions-yellow);
}

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

.card {
    background: var(--white);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 1rem;
}

.card h3 {
    margin-bottom: 15px;
    color: var(--primary);
    font-size: 1.25rem;
}

.card p {
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
    background: var(--white);
    color: var(--text);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.2);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px var(--shadow-sm);
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-primary);
}

.table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-muted);
}

.table tbody tr:hover {
    background: var(--bg-tertiary);
}

.status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status.draft {
    background: var(--status-draft-bg);
    color: var(--status-draft-text);
}

.status.completed {
    background: var(--status-completed-bg);
    color: var(--status-completed-text);
}

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

.stat-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px var(--shadow-sm);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--info);
    margin-bottom: 5px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.hidden {
    display: none !important;
}

.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: var(--bg-card);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 6px var(--shadow-sm);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h2 {
    color: #2196F3;
    margin-bottom: 10px;
}

.alert {
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.alert.error {
    background: var(--alert-error-bg);
    color: var(--alert-error-text);
    border: 1px solid var(--alert-error-border);
}

.alert.success {
    background: var(--alert-success-bg);
    color: var(--alert-success-text);
    border: 1px solid var(--alert-success-border);
}

.qr-container {
    text-align: center;
    padding: 20px;
}

.qr-code {
    background: white;
    padding: 20px;
    border-radius: 8px;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Navigation specific styles to override offline-app.css */
.admin-container .nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    padding: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
}

.admin-container .nav button {
    background: linear-gradient(135deg, #1565C0, #0D47A1);
    color: white;
    border: 2px solid #1565C0;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(21, 101, 192, 0.2);
}

.admin-container .nav button:hover {
    background: linear-gradient(135deg, #f9c910, #e6b800);
    color: #1565C0;
    border-color: #f9c910;
    box-shadow: 0 6px 20px rgba(249, 201, 16, 0.3);
    transform: translateY(-1px);
}

.admin-container .nav button.active {
    background: linear-gradient(135deg, #f9c910, #e6b800);
    color: #1565C0;
    border-color: #f9c910;
    box-shadow: 0 6px 20px rgba(249, 201, 16, 0.4);
    transform: translateY(-1px);
}

/* View system improvements */
.view {
    flex: 1;
    min-height: 400px;
    display: none !important;
    margin-top: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.view.active {
    display: block !important;
    opacity: 1;
}

/* Table container improvements */
.table-container {
    background: white;
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 20px 0;
}

/* Search and filter improvements */
.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.mb-3 {
    margin-bottom: 1rem;
}

.form-control.search-input {
    max-width: 300px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .admin-container {
        padding: 10px;
    }

    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .table {
        font-size: 14px;
    }

    .table th,
    .table td {
        padding: 8px;
    }

    .admin-container .nav {
        flex-direction: column;
        gap: 8px;
    }

    .admin-container .nav button {
        width: 100%;
        justify-content: center;
    }
}

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

.modal.show {
    display: block;
}

.modal-dialog {
    position: relative;
    width: auto;
    max-width: 500px;
    margin: 1.75rem auto;
    pointer-events: auto;
}

.modal-content {
    position: relative;
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
    padding: 0;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 500;
    color: #1565C0;
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1rem;
}

.modal-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    padding: 0.75rem;
    border-top: 1px solid #e9ecef;
    gap: 0.5rem;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #000;
    opacity: 0.5;
    cursor: pointer;
}

.btn-close:hover {
    opacity: 1;
}

/* Dark Mode Implementation matching occasion.html design */
body.dark-mode {
    --background: #1a1a1a;
    --text: #e8e8e8;
    --text-secondary: #b0b0b0;
    --white: #2c2c2c;
    --light: #3a3a3a;
    --border: #4a4a4a;

    /* Lions Club Dark Mode Colors */
    --primary: #4787db; /* Lighter Lions Blue for dark mode */
    --primary-dark: #1565C0;
    --lions-yellow: #f9c910;
    --lions-yellow-dark: #e6b800;

    /* Shadows with Lions Club colors */
    --shadow: 0 2px 8px rgba(71, 135, 219, 0.15);
    --shadow-lg: 0 8px 24px rgba(71, 135, 219, 0.2);
    --shadow-yellow: 0 4px 15px rgba(249, 201, 16, 0.25);

    /* Form specific colors for dark mode */
    --input-bg: #2a2a2a;
    --input-text: #ffffff;
    --input-border: #505050;
    --label-text: #d0d0d0;
    --placeholder-text: #808080;
}

/* Base dark mode styles */
body.dark-mode {
    background: var(--background);
    color: var(--text);
}

/* Header adjustments for dark mode with Lions Club theme */
body.dark-mode .header {
    background: linear-gradient(135deg, #0c0c0c, #1a1a1a);
    border-bottom: 1px solid #4a4a4a;
    border-top: 3px solid var(--lions-yellow);
}

body.dark-mode .header h1 {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

body.dark-mode .header-controls {
    color: #ffffff;
}

body.dark-mode .icon-button {
    color: #ffffff !important;
    background: transparent;
    border: none;
    opacity: 0.9;
}

body.dark-mode .icon-button:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Form sections with improved contrast */
body.dark-mode .card,
body.dark-mode .stat-card,
body.dark-mode .table,
body.dark-mode .login-container {
    background: var(--white);
    border: 1px solid var(--border);
}

/* Labels - Much brighter for readability */
body.dark-mode label,
body.dark-mode .form-group label {
    color: var(--label-text);
    font-weight: 500;
}

/* Input fields with better contrast */
body.dark-mode input[type="text"],
body.dark-mode input[type="number"],
body.dark-mode input[type="date"],
body.dark-mode input[type="password"],
body.dark-mode select,
body.dark-mode textarea,
body.dark-mode .form-control {
    background: var(--input-bg);
    color: var(--input-text);
    border: 1px solid var(--input-border);
}

body.dark-mode .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(71, 135, 219, 0.3);
}

/* Table styling for dark mode */
body.dark-mode .table th {
    background: var(--light);
    color: var(--text);
}

body.dark-mode .table tbody tr:hover {
    background: var(--light);
}

/* Navigation buttons for dark mode */
body.dark-mode .nav button {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

body.dark-mode .nav button:hover,
body.dark-mode .nav button.active {
    background: var(--lions-yellow);
    color: var(--primary);
    border-color: var(--lions-yellow);
}

/* Alert styling for dark mode */
body.dark-mode .alert.error {
    background: #2d1b1e;
    color: #f8d7da;
    border-color: #4a2c2f;
}

body.dark-mode .alert.success {
    background: #1b2d1e;
    color: #d4edda;
    border-color: #2f4a32;
}

/* Status badges for dark mode */
body.dark-mode .status.draft {
    background: #3d3a2e;
    color: #fff3cd;
}

body.dark-mode .status.completed {
    background: #1e3d22;
    color: #d4edda;
}
/* ========================================
   MODAL OVERLAY STYLES
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease-out;
}

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

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
}

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

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    background: var(--primary);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 20px;
    max-height: calc(90vh - 140px);
    overflow-y: auto;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border);
    background: var(--background);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Details table for view modal */
.details-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.details-table td {
    padding: 8px;
    border-bottom: 1px solid var(--border);
}

.details-table td:first-child {
    width: 40%;
    color: var(--text-secondary);
}

.details-table td:last-child {
    font-weight: 500;
}

/* Form styles for edit modal */
.form-group {
    margin-bottom: 15px;
}

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

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

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

.form-control[readonly] {
    background: #f5f5f5;
    color: #666;
    cursor: not-allowed;
}

/* Dark mode modal styles */
body.dark-mode .modal-content {
    background: #2d3748;
    color: #e2e8f0;
}

body.dark-mode .modal-header {
    background: #1a202c;
    border-bottom-color: #4a5568;
}

body.dark-mode .modal-footer {
    background: #1a202c;
    border-top-color: #4a5568;
}

body.dark-mode .details-table td {
    border-bottom-color: #4a5568;
}

body.dark-mode .form-control {
    background: #1a202c;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .form-control[readonly] {
    background: #374151;
    color: #9ca3af;
}
