/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --light: #f8fafc;
    --dark: #1e293b;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 8px;
}

body {
    background-color: var(--gray-100);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
header {
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

/* Container inside header */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    gap: 1rem;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.logo img {
    height: 40px;
    width: auto;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.logo img:hover {
    transform: scale(1.1);
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Balance badge */
.user-balance {
    background-color: var(--primary);
    color: #fff;
    padding: 0.4rem 0.9rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transition: background-color 0.3s ease, transform 0.2s ease;
    white-space: nowrap;
}

.user-balance:hover {
    background-color: #1a73e8;
    transform: translateY(-1px);
}

/* Hamburger Menu Styles */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    background: none;
    border: none;
    z-index: 1100;
    flex-shrink: 0;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--dark);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* Navigation Styles - DESKTOP */
nav {
    background-color: #ffffff;
    border-bottom: 1px solid var(--gray-200);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
}

.nav-item {
    padding: 1rem 1.5rem;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
    font-weight: 500;
}

.nav-item:hover {
    background-color: var(--gray-100);
    border-bottom-color: var(--gray-300);
}

.nav-item.active {
    border-bottom-color: var(--primary);
    color: var(--primary);
}

.nav-item.logout {
    margin-left: auto;
    color: var(--error);
}

.nav-item.logout:hover {
    border-bottom-color: var(--error);
}

/* Mobile Styles */
@media (max-width: 768px) {
    /* Compact single-line header for mobile */
    header {
        padding: 0.5rem 1rem;
        height: 60px;
    }

    .header-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 0;
        gap: 0.5rem;
    }

    .logo {
        font-size: 1.1rem;
        flex: 0 1 auto;
        min-width: 0;
        overflow: hidden;
    }

    .logo span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .logo img {
        height: 32px;
        flex-shrink: 0;
    }

    .user-info {
        gap: 0.5rem;
        flex: 0 0 auto;
    }

    .user-balance {
        font-size: 0.8rem;
        padding: 0.3rem 0.7rem;
    }

    /* Hamburger visible and properly positioned */
    .hamburger {
        display: flex;
        order: 3;
        margin-left: 0.5rem;
    }

    /* FIX: Show mobile navigation menu */
    .mobile-nav-menu {
        position: fixed;
        left: -100%;
        top: 60px; /* Start below header */
        flex-direction: column;
        background-color: #ffffff;
        width: 85%;
        max-width: 300px;
        height: calc(100vh - 60px);
        box-shadow: 0 0 20px rgba(0,0,0,0.15);
        transition: left 0.3s ease;
        z-index: 1000;
        padding: 1rem 0;
        align-items: stretch;
        overflow-y: auto;
    }

    .mobile-nav-menu.active {
        left: 0;
    }

    .mobile-nav-item {
        padding: 1.2rem 1.5rem;
        border-left: 4px solid transparent;
        border-bottom: 1px solid var(--gray-200);
        font-size: 1rem;
        margin: 0;
        color: var(--dark);
        text-decoration: none;
        display: block;
        transition: all 0.3s ease;
        cursor: pointer;
    }

    .mobile-nav-item:hover,
    .mobile-nav-item.active {
        border-left-color: var(--primary);
        background-color: var(--gray-100);
        border-bottom-color: var(--gray-200);
    }

    .mobile-nav-item.logout {
        margin-top: auto;
        border-top: 1px solid var(--gray-200);
        border-bottom: none;
        color: var(--error);
    }

    /* Overlay for menu */
    .overlay {
        display: none;
        position: fixed;
        top: 60px; /* Start below header */
        left: 0;
        width: 100%;
        height: calc(100vh - 60px);
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .overlay.active {
        display: block;
    }

    /* Hide desktop navigation on mobile */
    nav {
        display: none;
    }
}

/* Close button for mobile menu */
.close-menu {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--secondary);
    padding: 0.5rem;
    z-index: 1001;
}

.close-menu:hover {
    color: var(--dark);
}

/* Main Content */
main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.page-title {
    margin-bottom: 1.5rem;
    color: var(--dark);
    font-size: 1.75rem;
}

/* Card Styles */
.card {
    background-color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
    font-size: 1.25rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-success {
    background-color: var(--success);
    color: white;
}

.btn-success:hover {
    background-color: #0d9668;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--gray-300);
    color: var(--dark);
}

.btn-outline:hover {
    background-color: var(--gray-100);
}

.btn-block {
    width: 100%;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    background-color: var(--gray-100);
    font-weight: 600;
}

.table tbody tr:hover {
    background-color: var(--gray-100);
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-error {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

/* Alert Styles */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
}

.alert-info {
    background-color: rgba(37, 99, 235, 0.1);
    border: 1px solid var(--primary);
    color: var(--primary);
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Login Page Specific */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    margin-bottom: 1.5rem;
}

.login-title {
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--secondary);
    margin-bottom: 2rem;
}

.google-signin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    background-color: white;
    border: 1px solid var(--gray-300);
    color: var(--dark);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.google-signin-btn:hover {
    background-color: var(--gray-100);
    box-shadow: var(--shadow);
}

.google-icon {
    width: 20px;
    height: 20px;
}

/* Footer */
footer {
    background-color: var(--dark);
    color: white;
    text-align: center;
    padding: 1.5rem;
    margin-top: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    main {
        padding: 1rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
}

/* Ultra small mobile devices */
@media (max-width: 480px) {
    header {
        padding: 0.4rem 0.75rem;
    }
    
    .logo {
        font-size: 1rem;
    }
    
    .logo img {
        height: 28px;
    }
    
    .user-balance {
        font-size: 0.75rem;
        padding: 0.25rem 0.6rem;
    }
    
    .hamburger {
        padding: 0.4rem;
    }
    
    .hamburger span {
        width: 22px;
        height: 2px;
    }
}


