/* ==========================================
   MOBILE-FIRST PWA STYLES WITH LEFT SIDEBAR
   ========================================== */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --primary-dark: #1a252f;
    --accent-color: #3498db;
    --accent-hover: #2980b9;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #1abc9c;
    --text-color: #333;
    --text-light: #7f8c8d;
    --bg-color: #f5f5f5;
    --sidebar-width: 280px;
    --header-height: 60px;
    --transition-speed: 0.3s;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: hidden;
}

/* ==========================================
   MOBILE HEADER (visible on mobile only)
   ========================================== */
.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.mobile-title {
    flex: 1;
    font-size: 1.25rem;
    text-align: center;
    margin: 0 1rem;
}

.mobile-user-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
}

/* Hamburger Menu */
.hamburger {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all var(--transition-speed);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ==========================================
   DESKTOP HEADER (visible on desktop only)
   ========================================== */
.desktop-header {
    display: none;
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: var(--primary-color);
    border-bottom: 1px solid var(--primary-dark);
    z-index: 999;
    transition: left var(--transition-speed);
}

.desktop-header.sidebar-hidden {
    left: 0;
}

.desktop-header-content {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 1.5rem;
    gap: 1rem;
}

.desktop-hamburger {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    flex-shrink: 0;
}

.desktop-hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all var(--transition-speed);
}

.desktop-hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.desktop-hamburger.active span:nth-child(2) {
    opacity: 0;
}

.desktop-hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.desktop-breadcrumb {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    flex: 1;
}

.desktop-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.desktop-user-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.desktop-user-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ==========================================
   LEFT SIDEBAR NAVIGATION
   ========================================== */
.sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--primary-color);
    color: white;
    display: flex;
    flex-direction: column;
    transition: left var(--transition-speed);
    z-index: 1001;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    padding: 1rem 1.5rem;
    background: var(--primary-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: var(--header-height);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    margin: 0;
}

.sidebar-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}





.sidebar-user {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: white;
    transition: background-color var(--transition-speed);
}

.sidebar-user:hover {
    background-color: rgba(255,255,255,0.1);
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: bold;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.7);
    text-transform: capitalize;
}

.sidebar-menu {
    flex: 1;
    list-style: none;
    padding: 0.5rem 0;
}

.sidebar-menu li {
    margin: 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.25rem;
    color: white;
    text-decoration: none;
    transition: background-color var(--transition-speed);
}

.menu-item:hover,
.menu-item:focus {
    background-color: rgba(255,255,255,0.1);
}

.menu-item:active {
    background-color: rgba(255,255,255,0.15);
}

.menu-icon {
    font-size: 1.25rem;
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

.menu-text {
    font-size: 0.95rem;
}

/* Submenu Styles */
.has-submenu {
    position: relative;
}

.submenu-toggle {
    justify-content: flex-start;
}

.submenu-arrow {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform var(--transition-speed);
}

.has-submenu.open .submenu-arrow {
    transform: rotate(90deg);
}

.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    background: rgba(0,0,0,0.1);
    transition: max-height 0.3s ease-out;
}

.has-submenu.open .submenu {
    max-height: 500px;
}

.submenu .menu-item {
    padding: 0.5rem 1.25rem 0.5rem 2.75rem;
    font-size: 0.9rem;
}

.submenu .menu-icon {
    font-size: 1.1rem;
    width: 1.1rem;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    text-align: center;
}

.sidebar-footer .version {
    margin-top: 0.25rem;
}

/* Sidebar Overlay (for mobile) */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-speed), visibility var(--transition-speed);
    z-index: 1000;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ==========================================
   MAIN CONTENT AREA
   ========================================== */
.main-content {
    padding-top: var(--header-height);
    min-height: 100vh;
    transition: margin-left var(--transition-speed);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* ==========================================
   FLASH MESSAGES
   ========================================== */
/* ==========================================
   FLASH MESSAGES
   ========================================== */
.flash-messages {
    margin-bottom: 1rem;
}

.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.close-alert {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-alert:hover {
    opacity: 1;
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: all var(--transition-speed);
    text-align: center;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: #d68910;
}

.btn-info {
    background-color: var(--info-color);
    color: white;
}

.btn-info:hover {
    background-color: #16a085;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ==========================================
   FORMS
   ========================================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color var(--transition-speed);
    -webkit-appearance: none;
    appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.form-actions .btn {
    flex: 1;
    min-width: 120px;
}

/* ==========================================
   LOGIN PAGE
   ========================================== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 300% 300%;
    animation: gradientShift 8s ease infinite;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 
        0 20px 60px rgba(0,0,0,0.2),
        0 0 0 1px rgba(255,255,255,0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.login-card:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 25px 80px rgba(0,0,0,0.25),
        0 0 0 1px rgba(255,255,255,0.3);
}

.login-card h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
}

.login-card h2 {
    text-align: center;
    color: var(--text-light);
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: 2rem;
}

/* ==========================================
   DASHBOARD
   ========================================== */
.dashboard-header {
    margin-bottom: 1.5rem;
}

.dashboard-header h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: center;
}

.stat-card h3 {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent-color);
}

.dashboard-content {
    display: grid;
    gap: 1rem;
}

.info-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.info-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.actions .btn {
    flex: 1;
    min-width: 140px;
}

/* ==========================================
   TABLE
   ========================================== */
.table-container {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.table th,
.table td {
    padding: 0.875rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--primary-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.table tbody tr {
    transition: background-color 0.2s;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ==========================================
   BADGES
   ========================================== */
.badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge-admin {
    background-color: var(--danger-color);
    color: white;
}

.badge-president {
    background-color: #9b59b6;
    color: white;
}

.badge-secretary {
    background-color: var(--accent-color);
    color: white;
}

.badge-financial_secretary {
    background-color: var(--success-color);
    color: white;
}

.badge-success {
    background-color: var(--success-color);
    color: white;
}

.badge-danger {
    background-color: var(--danger-color);
    color: white;
}

/* ==========================================
   PAGE HEADERS
   ========================================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-header h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin: 0;
}

/* ==========================================
   FORM CONTAINER
   ========================================== */
.form-container {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    max-width: 600px;
}

/* ==========================================
   PROFILE SECTION
   ========================================== */
.profile-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
}

.profile-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

/* ==========================================
   ERROR PAGE
   ========================================== */
.error-page {
    text-align: center;
    padding: 4rem 1rem;
}

.error-page h1 {
    font-size: 4rem;
    color: var(--danger-color);
    margin-bottom: 1rem;
}

.error-page h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.error-page p {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* ==========================================
   RESPONSIVE - TABLET (768px and up)
   ========================================== */
@media (min-width: 768px) {
    .mobile-header {
        display: none;
    }
    
    .desktop-header {
        display: block;
    }
    
    .sidebar {
        left: 0;
        transition: left var(--transition-speed);
    }
    
    .sidebar.desktop-hidden {
        left: calc(-1 * var(--sidebar-width));
    }
    
    .sidebar-close {
        display: none;
    }
    
    .sidebar-overlay {
        display: none;
    }
    
    .main-content {
        margin-left: var(--sidebar-width);
        padding-top: var(--header-height);
        transition: margin-left var(--transition-speed);
    }
    
    .main-content.sidebar-hidden {
        margin-left: 0;
    }
    
    .container {
        padding: 2rem;
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .table-container {
        padding: 1.5rem;
    }
    
    .login-card {
        padding: 3rem;
    }
    
    .error-page h1 {
        font-size: 6rem;
    }
    
    .error-page h2 {
        font-size: 2rem;
    }
}

/* ==========================================
   RESPONSIVE - DESKTOP (1024px and up)
   ========================================== */
@media (min-width: 1024px) {
    .dashboard-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .actions .btn {
        flex: 0 1 auto;
    }
}

/* ==========================================
   RESPONSIVE - LARGE DESKTOP (1440px and up)
   ========================================== */
@media (min-width: 1440px) {
    .dashboard-stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ==========================================
   PRINT STYLES
   ========================================== */
@media print {
    .mobile-header,
    .sidebar,
    .sidebar-overlay,
    .hamburger {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding-top: 0;
    }
}

/* ==========================================
   CUSTOM MESSAGE BOX
   ========================================== */
.message-box-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 1rem;
}

.message-box-overlay.show {
    display: flex !important;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.message-box {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 450px;
    width: 100%;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.message-box-header {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #eee;
    gap: 0.75rem;
}

.message-box-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message-box-icon.success {
    background-color: #d4edda;
    color: var(--success-color);
}

.message-box-icon.error {
    background-color: #f8d7da;
    color: var(--danger-color);
}

.message-box-icon.warning {
    background-color: #fff3cd;
    color: var(--warning-color);
}

.message-box-icon.info {
    background-color: #d1ecf1;
    color: var(--accent-color);
}

.message-box-icon.confirm {
    background-color: #e8f4fd;
    color: var(--accent-color);
}

.message-box-title {
    flex: 1;
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
}

.message-box-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.message-box-close:hover {
    background-color: #f5f5f5;
    color: var(--text-color);
}

.message-box-body {
    padding: 1.5rem;
}

.message-box-content {
    margin: 0;
    color: var(--text-color);
    font-size: 1rem;
    line-height: 1.6;
}

.message-box-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background-color: #f8f9fa;
    border-top: 1px solid #eee;
}

.message-box-footer .btn {
    min-width: 100px;
    padding: 0.625rem 1.25rem;
}

/* Message Box Button Variants */
.message-box-footer .btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.message-box-footer .btn-danger:hover {
    background-color: #c0392b;
}

/* Single button centered */
.message-box-footer.single-btn {
    justify-content: center;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .message-box {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    .message-box-header {
        padding: 1rem;
    }
    
    .message-box-body {
        padding: 1rem;
    }
    
    .message-box-footer {
        padding: 1rem;
        flex-direction: column-reverse;
    }
    
    .message-box-footer .btn {
        width: 100%;
    }
}
