:root {
    --background: #f0fdf4;
    /* Very light green tin */
    --foreground: #1a2e1a;
    /* Dark green/black */
    --card: #ffffff;
    --card-foreground: #1a2e1a;
    --primary: #16a34a;
    /* Green-600 */
    --primary-foreground: #ffffff;
    --secondary: #dcfce7;
    /* Green-100 */
    --secondary-foreground: #14532d;
    /* Green-900 */
    --muted: #f3f4f6;
    --muted-foreground: #6b7280;
    --border: #e5e7eb;
    --success: #22c55e;
    --warning: #eab308;
    --destructive: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 1rem;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    margin: 0;
    padding: 70px 1rem 90px;
    min-height: 100vh;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0 0 1rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--foreground);
}

h1 {
    font-size: 1.875rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

/* Header */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.025em;
}

/* Navigation */
.main-nav {
    display: none;
    align-items: center;
    gap: 1rem;
}

.nav-link-desktop {
    color: var(--muted-foreground);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.nav-link-desktop:hover,
.nav-link-desktop.active {
    color: var(--primary);
    background-color: var(--secondary);
}

.nav-profile-photo {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--primary);
    transition: transform 0.2s;
}

.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--muted-foreground);
    text-decoration: none;
    flex: 1;
    height: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.nav-link.active {
    color: var(--primary);
}

.nav-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    transition: transform 0.3s;
}

.nav-link.active .nav-icon {
    transform: translateY(-2px);
}

.nav-label {
    font-size: 0.75rem;
    font-weight: 600;
}

.nav-profile-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid currentColor;
    margin-bottom: 0.25rem;
    flex-shrink: 0;
}

/* Cards & Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-container,
.profile-container,
.auth-container,
.admin-container,
.payment-container,
.history-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.auth-container {
    max-width: 800px;
    margin: 3rem auto;
    padding: 0 1rem;
}

.auth-card-top {
    background-color: var(--card);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    margin-bottom: 3rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.auth-welcome-title {
    text-align: center;
    color: var(--foreground);
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 800;
}

.auth-welcome-subtitle {
    text-align: center;
    color: var(--muted-foreground);
    margin-bottom: 2rem;
}

.auth-toggle {
    display: flex;
    background-color: var(--muted);
    padding: 0.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    width: 100%;
}

.auth-toggle button {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    color: var(--muted-foreground);
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-toggle button.active {
    background-color: var(--card);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.small-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--foreground);
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.input-light {
    background-color: #f0fdf4;
    /* Light green/blue tint */
    border: 1px solid transparent;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1rem;
    width: 100%;
    color: var(--foreground);
    transition: all 0.2s;
}

.input-light:focus {
    background-color: #ffffff;
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.1);
}

.btn-block {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

/* Feature Cards at bottom */
.auth-features {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.feature-card {
    background-color: var(--card);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    flex: 1;
    min-width: 250px;
    text-align: center;
    border: 1px solid var(--border);
}

.feature-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.feature-card p {
    color: var(--muted-foreground);
    font-size: 0.9rem;
    line-height: 1.5;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    background-color: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-icon {
    width: 50px;
    height: 50px;
    background-color: var(--secondary);
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--primary-foreground);
    box-shadow: 0 4px 14px 0 rgba(22, 163, 74, 0.39);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(22, 163, 74, 0.23);
    filter: brightness(1.1);
}

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

.btn-secondary:hover {
    filter: brightness(0.95);
}

.btn-destructive {
    background-color: #fee2e2;
    color: #ef4444;
}

.btn-destructive:hover {
    background-color: #fecaca;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--foreground);
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background-color: var(--card);
    color: var(--foreground);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--secondary);
}

/* Dashboard Specifics */
.user-header-widget {
    background: linear-gradient(135deg, var(--primary), #15803d);
    color: white;
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.user-header-widget::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.1) 40%, rgba(255, 255, 255, 0.1) 60%, transparent 60%);
    pointer-events: none;
}

.user-header-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.5);
    object-fit: cover;
    background-color: white;
}

.user-header-info h2 {
    color: white;
    margin: 0;
    font-size: 1.75rem;
}

.user-header-info p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0.25rem 0 0;
    font-size: 0.95rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* Profile Page */
.profile-hero {
    background-color: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.profile-cover {
    height: 150px;
    background: linear-gradient(to right, var(--secondary), var(--primary));
}

.profile-content {
    padding: 0 2rem 2rem;
    text-align: center;
    margin-top: -60px;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--card);
    box-shadow: var(--shadow);
    object-fit: cover;
    background-color: white;
    margin-bottom: 1rem;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
    background-color: var(--muted);
    padding: 1rem;
    border-radius: 0.75rem;
}

.stat-item h4 {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.stat-item p {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.profile-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background-color: var(--card);
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    color: var(--foreground);
    font-weight: 500;
}

.profile-menu-item:hover {
    border-color: var(--primary);
    background-color: var(--secondary);
}

/* Desktop Media Query */
@media (min-width: 768px) {
    body {
        padding: 90px 2rem 2rem;
    }

    .main-header {
        padding: 0 2rem;
    }

    .main-nav {
        display: flex;
    }

    .mobile-nav {
        display: none;
    }

    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }

    .profile-hero {
        max-width: 700px;
        margin: 0 auto;
    }
}

/* Admin Dashboard Styles */
.admin-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    margin-top: 2rem;
    align-items: start;
}

.admin-sidebar {
    background-color: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 500;
    color: var(--muted-foreground);
    transition: all 0.2s;
    margin-bottom: 0.5rem;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
}

.sidebar-link:hover,
.sidebar-link.active {
    background-color: var(--secondary);
    color: var(--primary);
    font-weight: 600;
}

.admin-main-content {
    background-color: transparent;
    width: 100%;
    overflow: hidden;
    /* Prevent overflow from tables */
}

.admin-section-card {
    background-color: var(--card);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

/* Dashboard Tables */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    background-color: var(--card);
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    white-space: nowrap;
}

.dashboard-table th {
    background-color: var(--muted);
    font-weight: 600;
    text-align: left;
    padding: 1rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--muted-foreground);
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

.dashboard-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--foreground);
    vertical-align: middle;
}

.dashboard-table tr:last-child td {
    border-bottom: none;
}

.dashboard-table tr:hover td {
    background-color: rgba(0, 0, 0, 0.01);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-verified,
.status-paid,
.status-active,
.status-admin,
.status-current {
    background-color: #dcfce7;
    color: #166534;
}

.status-pending,
.status-student {
    background-color: #fef9c3;
    color: #854d0e;
}

.status-rejected,
.status-inactive,
.status-not_current {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Mobile Admin */
@media (max-width: 900px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
        flex-direction: row;
        overflow-x: auto;
        padding: 0.5rem;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .sidebar-link {
        white-space: nowrap;
        margin-bottom: 0;
        flex-shrink: 0;
    }
}
/* PWA Install Button Styles */
.pwa-install-container {
    position: fixed;
    bottom: 80px; /* Above the mobile nav */
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
    pointer-events: none;
}

.pwa-install-btn {
    pointer-events: auto;
    background-color: #22c55e;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: all 0.2s ease;
    animation: slideUp 0.3s ease-out;
}

.pwa-install-btn:hover {
    background-color: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.pwa-install-btn i {
    font-size: 1rem;
}

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

/* For desktop where there is no mobile nav */
@media (min-width: 768px) {
    .pwa-install-container {
        bottom: 2rem;
        right: 2rem;
        left: auto;
        justify-content: flex-end;
    }
}
