/* =========================================
   Global Styles & Reset
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #5B8FE8;
    --primary-dark: #1B4194;
    --secondary-color: #64748b;
    --success-color: #16a34a;
    --danger-color: #f06c6c;
    --warning-color: #f59e0b;
    --info-color: #0ea5e9;
    --light-bg: #f8fafc;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--light-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* =========================================
   Navigation Bar
   ========================================= */
.navbar {
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-admin {
    background: linear-gradient(135deg, #5B8FE8 0%, #1B4194 100%);
    color: white;
}

.navbar-admin a {
    color: white !important;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand a {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-logo {
    height: 45px;
    width: 45px;
    object-fit: contain;
}

.navbar-menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.navbar-menu a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.navbar-menu a:hover {
    color: var(--primary-color);
}

/* =========================================
   Container & Layout
   ========================================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

.main-content {
    flex: 1;
    padding: 2rem 0;
}

.admin-content {
    background: var(--light-bg);
}

/* =========================================
   Hero Section
   ========================================= */
.hero {
    background: linear-gradient(135deg, #5B8FE8 0%, #1B4194 100%);
    color: white;
    padding: 2rem 1.5rem;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.hero p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* =========================================
   Alerts & Flash Messages
   ========================================= */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.alert ul {
    list-style: none;
    padding: 0;
}

.alert li {
    margin-bottom: 0.5rem;
}

.alert-success {
    background: #dcfce7;
    border-color: var(--success-color);
    color: #166534;
}

.alert-error {
    background: #fee2e2;
    border-color: var(--danger-color);
    color: #991b1b;
}

.alert-info {
    background: #dbeafe;
    border-color: var(--info-color);
    color: #1e40af;
}

/* =========================================
   Shifts Calendar
   ========================================= */
.shifts-calendar {
    margin-top: 2rem;
}

.shifts-calendar h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    text-align: center;
}

.stall-group {
    margin-bottom: 3rem;
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.stall-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--primary-color);
}

.stall-name {
    font-size: 1.75rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.stall-description {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.date-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.date-section:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.shift-date {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    font-weight: 600;
}

/* Stall Tabs */
.stall-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
}

.stall-tab-button {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 1rem 1.75rem;
    font-size: 1rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 0;
    transition: all 0.2s ease;
    font-weight: 600;
    position: relative;
    margin-bottom: -2px;
}

.stall-tab-button:hover {
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.stall-tab-button.active {
    color: var(--primary-color);
    background: transparent;
    border-bottom-color: var(--primary-color);
}

.stall-tab-content {
    display: none;
    animation: fadeInTab 0.3s ease;
}

.stall-tab-content.active {
    display: block;
}

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

/* Stall Header Info */
.stall-header-info {
    margin-bottom: 2rem;
    text-align: center;
}

.stall-header-info h3 {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.stall-header-info .stall-description {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 700px;
    margin: 0 auto;
}

/* Calendar Day-Column Layout (Each day in its own column) */
.calendar-day-columns {
    max-width: 600px;
    margin: 0 auto 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.calendar-day-column {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.calendar-day-column:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.calendar-day-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.25rem;
    text-align: center;
}

.calendar-day-header .day-number {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.calendar-day-header .day-name {
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.15rem;
}

.calendar-day-header .day-month {
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: capitalize;
}

.day-shifts-list {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #f3f4f6;
}

/* Compact Shift Cards for Calendar View */
.shift-card-compact {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.shift-card-compact:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
    border-color: #d1d5db;
}

.shift-card-compact.shift-claimed {
    border-color: var(--success-color);
    background: #f0fdf4;
    box-shadow: 0 2px 4px rgba(34, 197, 94, 0.15);
}

.shift-card-compact.shift-full {
    background: #f9fafb;
    border-color: #d1d5db;
}

.shift-card-compact .shift-time {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-size: 1.15rem;
}

.shift-card-compact .shift-volunteers {
    text-align: center;
    margin-bottom: 0.75rem;
}

.shift-card-compact .volunteer-count {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.shift-card-compact .volunteer-count.full {
    color: var(--success-color);
}

.shift-card-compact .shift-status {
    text-align: center;
    margin-bottom: 0.75rem;
}

.shift-card-compact .status-badge {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
}

.shift-card-compact .shift-action {
    text-align: center;
}

.btn-compact {
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    width: 100%;
    font-weight: 600;
}

.text-muted-small {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    display: block;
}

/* Shift claimed/full states */
.shift-claimed {
    border-color: var(--success-color);
    background: #f0fdf4;
}

.shift-full {
    opacity: 0.7;
}

/* Badges */
.availability-badge,
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.availability-badge {
    background: var(--light-bg);
    color: var(--text-primary);
}

.badge-available {
    background: #dbeafe;
    color: #1e40af;
}

.badge-full {
    background: #dcfce7;
    color: #16a34a;
}

.status-badge {
    text-transform: uppercase;
    font-size: 0.75rem;
}

.status-available {
    background: var(--success-color);
    color: white;
}

.status-full {
    background: var(--secondary-color);
    color: white;
}

.status-claimed {
    background: var(--info-color);
    color: white;
}

.shift-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.claimed-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}

.claimed-actions .text-success {
    font-weight: 500;
    font-size: 0.95rem;
}

.claimed-actions form {
    width: 100%;
}

.claimed-actions .btn {
    width: 100%;
}

/* =========================================
   Forms
   ========================================= */
.form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    max-width: 600px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

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

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

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

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-group label {
    display: block;
}

.form-group label input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
    cursor: pointer;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* =========================================
   Buttons
   ========================================= */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

.btn-secondary:hover {
    background: #475569;
}

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

.btn-danger:hover {
    background: #b91c1c;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
}

/* =========================================
   Auth Pages
   ========================================= */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.auth-box {
    background: white;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 450px;
}

.auth-box h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.auth-box p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.auth-links {
    margin-top: 1.5rem;
    text-align: center;
}

.auth-links a {
    color: var(--primary-color);
    font-weight: 600;
}

/* =========================================
   Profile/Dashboard
   ========================================= */
.profile-header {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.profile-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.profile-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.my-shifts-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.my-shift-card {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: border-color 0.2s;
}

.my-shift-card:hover {
    border-color: var(--primary-color);
}

.shift-date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: white;
    padding: 0.75rem;
    border-radius: 8px;
    min-width: 80px;
}

.shift-date-badge .day {
    font-size: 2rem;
    font-weight: bold;
    line-height: 1;
}

.shift-date-badge .month {
    font-size: 0.9rem;
    text-transform: uppercase;
    margin-top: 0.25rem;
}

.shift-details {
    flex: 1;
}

.shift-details h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.shift-volunteers {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.profile-actions {
    text-align: center;
    margin-top: 2rem;
}

/* =========================================
   Admin Panel
   ========================================= */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.admin-header h1 {
    font-size: 2rem;
    color: var(--text-primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.stat-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.admin-quick-actions {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.admin-quick-actions h2 {
    margin-bottom: 1rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.admin-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

/* Admin Shifts Organization */
.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
}

.admin-shifts-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.admin-date-group {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
}

.admin-date-header {
    background: linear-gradient(135deg, #5B8FE8 0%, #1B4194 100%);
    color: white;
    padding: 1rem 1.5rem;
    margin: 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.shift-count {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: normal;
}

.volunteer-count {
    font-weight: 600;
    color: var(--text-primary);
}

.shift-row-full {
    background-color: #f0fdf4;
}

.badge-partial {
    background-color: #cffafe;
    color: #0e7490;
}

.admin-date-group .table {
    box-shadow: none;
    border-radius: 0;
    margin: 0;
}

.admin-date-group .table thead {
    background: #f8fafc;
}

/* View Toggle Tabs */
.view-toggle-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.view-tab {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: -2px;
}

.view-tab:hover {
    color: var(--primary-color);
    background: var(--light-bg);
}

.view-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.view-container {
    display: none;
}

.view-container.active {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* =========================================
   Tables
   ========================================= */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.table thead {
    background: var(--light-bg);
}

.table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

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

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

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

.table .actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Sortable table styles */
.sortable-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s;
}

.sortable-table th.sortable:hover {
    background: var(--border-color);
}

.sortable-table th.sortable .sort-indicator {
    font-size: 0.75rem;
    color: var(--primary-color);
    margin-left: 0.25rem;
}

.sortable-table th.sortable.sort-asc,
.sortable-table th.sortable.sort-desc {
    background: #e0e7ff;
}

/* =========================================
   Utilities
   ========================================= */
.text-success {
    color: var(--success-color);
    font-weight: 600;
}

.text-muted {
    color: var(--text-muted);
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.back-link {
    margin-bottom: 1.5rem;
}

.back-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.back-link a:hover {
    text-decoration: underline;
}

/* =========================================
   Footer
   ========================================= */
.footer {
    background: white;
    padding: 2rem 0;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-secondary);
}

/* =========================================
   Responsive Design
   ========================================= */

/* Tablet breakpoint */
@media (max-width: 992px) {
    .stall-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        padding: 0.5rem 0.75rem 1rem;
        margin-left: -0.75rem;
        margin-right: -0.75rem;
        scrollbar-width: none;
        -ms-overflow-style: none;
        scroll-snap-type: x proximity;
        border-bottom: none;
        gap: 0.625rem;
    }
    
    .stall-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .stall-tab-button {
        flex-shrink: 0;
        white-space: nowrap;
        scroll-snap-align: start;
        padding: 0.75rem 1.25rem;
        border: 2px solid var(--border-color);
        border-radius: 6px;
        background: white;
        margin-bottom: 0;
    }
    
    .stall-tab-button.active {
        background: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
    }
    
    .stall-tab-button:hover {
        background: rgba(102, 126, 234, 0.1);
    }
    
    .stall-tab-button.active:hover {
        background: var(--primary-color);
    }
}

/* Mobile breakpoint */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .navbar-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .my-shift-card {
        flex-direction: column;
    }
    
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .admin-header > div {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .admin-header .btn {
        width: 100%;
        text-align: center;
    }
    
    .table {
        font-size: 0.875rem;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
    }
    
    /* Make admin tables scrollable on mobile */
    .table thead {
        position: sticky;
        top: 0;
        background: var(--light-bg);
        z-index: 10;
    }
    
    .action-buttons,
    .actions {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .actions .btn {
        width: 100%;
        margin: 0;
    }
    
    .btn-block {
        width: 100%;
    }
    
    .shift-view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .shift-view-header h1 {
        font-size: 1.5rem;
    }
    
    .info-grid-compact {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .add-volunteer-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .view-toggle-tabs {
        flex-direction: column;
    }
    
    .view-tab {
        width: 100%;
    }
    
    /* Stack form rows on mobile */
    .form-group {
        margin-bottom: 1rem;
    }
    
    /* Mobile-friendly stall tabs */
    .stall-tabs {
        padding: 0.5rem 0.75rem 1rem;
        margin-left: -0.75rem;
        margin-right: -0.75rem;
        gap: 0.625rem;
        border-bottom: none;
        flex-wrap: wrap;
    }
    
    .stall-tab-button {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        border: 2px solid var(--border-color);
        border-radius: 6px;
        background: white;
        margin-bottom: 0;
        flex: 0 1 auto;
        white-space: nowrap;
    }
    
    .stall-tab-button.active {
        background: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
    }
    
    .stall-tab-button:hover {
        background: rgba(102, 126, 234, 0.1);
    }
    
    .stall-tab-button.active:hover {
        background: var(--primary-color);
    }
    
    /* Mobile-friendly day-column layout */
    .calendar-day-columns {
        max-width: 100%;
        padding: 0 0.5rem;
    }
    
    .calendar-day-column {
        max-width: 100%;
    }
}

/* =========================================
   Admin Cards & Grid
   ========================================= */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.admin-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.card-header {
    background: var(--light-bg);
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    font-size: 1.25rem;
    margin: 0;
    color: var(--text-primary);
}

.card-body {
    padding: 1.5rem;
}

/* Info Grid for Account Information */
.info-grid {
    display: grid;
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--light-bg);
    border-radius: 4px;
}

.info-item strong {
    color: var(--text-primary);
}

.info-item span {
    color: var(--text-secondary);
}

/* Badge Styles */
.badge-admin {
    background: var(--danger-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge-info {
    background: #5B8FE8;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-block;
    text-decoration: none;
    transition: all 0.2s ease;
}

a.badge-info:hover {
    background: #1B4194;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(27, 65, 148, 0.3);
    cursor: pointer;
}

/* Role Badge Styles */
.role-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-user {
    background: #e2e8f0;
    color: #475569;
}

.badge-job-admin {
    background: #dbeafe;
    color: #1e40af;
}

.badge-shift-admin {
    background: #fef3c7;
    color: #b45309;
}

.badge-super-admin {
    background: #fee2e2;
    color: #991b1b;
}

/* Job Status Badge Styles */
.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-secondary {
    background: #e2e8f0;
    color: #475569;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* =========================================
   Profile Tabs
   ========================================= */
.profile-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-button {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tab-button:hover {
    color: var(--primary-color);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

.profile-form {
    max-width: 600px;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.profile-info,
.password-tips {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.password-tips ul {
    margin: 1rem 0 0 1.5rem;
}

.password-tips li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* =========================================
   Shift View Page (Admin)
   ========================================= */
.shift-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

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

.shift-view-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: box-shadow 0.2s;
    margin-bottom: 2rem;
}

.shift-view-card-full {
    width: 100%;
}

.shift-view-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.card-header-view {
    background: linear-gradient(135deg, #5B8FE8 0%, #1B4194 100%);
    color: white;
    padding: 1.5rem;
}

.card-header-view h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.card-body-view {
    padding: 1.5rem;
}

.shift-info-compact {
    padding: 1rem 1.5rem;
}

.info-grid-compact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.info-item-compact {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.info-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.info-label-compact {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.info-value-compact {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.info-row {
    display: flex;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 120px;
}

.info-value {
    color: var(--text-primary);
    flex: 1;
}

.capacity-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
}

.capacity-full {
    background: #dcfce7;
    color: #16a34a;
}

.volunteers-table {
    margin: 0;
}

.volunteers-table td a {
    color: var(--primary-color);
    text-decoration: none;
}

.volunteers-table td a:hover {
    text-decoration: underline;
}

.add-volunteer-section {
    margin-bottom: 1.5rem;
}

.add-volunteer-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.add-volunteer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.add-volunteer-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.divider-or {
    text-align: center;
    position: relative;
    margin: 2rem 0;
}

.divider-or::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: var(--border-color);
}

.divider-or span {
    background: white;
    padding: 0 1rem;
    position: relative;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.empty-text {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    font-style: italic;
}

.btn-success {
    background: #16a34a;
    color: white;
}

.btn-success:hover {
    background: #15803d;
}

/* =========================================
   PWA Update UI
   ========================================= */
.pwa-update-notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 1001;
    text-align: center;
    min-width: 300px;
    animation: slideInDown 0.5s ease;
}

@keyframes slideInDown {
    from {
        transform: translate(-50%, -100px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

.pwa-update-notification p {
    margin: 0 0 1rem 0;
    font-weight: 600;
    color: var(--text-primary);
}

.pwa-update-notification button {
    margin: 0.25rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pwa-update-notification button:first-of-type {
    background: var(--primary-color);
    color: white;
}

.pwa-update-notification button:first-of-type:hover {
    background: var(--primary-hover);
}

.pwa-update-notification button:last-of-type {
    background: var(--light-bg);
    color: var(--text-secondary);
}

.pwa-update-notification button:last-of-type:hover {
    background: #d1d5db;
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .hero {
        padding: 2rem 1rem;
    }
    
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .auth-box {
        padding: 1.5rem;
    }
    
    .card-body-view {
        padding: 1rem;
    }
    
    .volunteer-card {
        flex-direction: column;
        gap: 1rem;
    }
    
    .volunteer-actions {
        margin-left: 0;
        width: 100%;
    }
    
    .volunteer-actions .btn {
        width: 100%;
    }
    
    /* Admin mobile optimizations */
    .admin-header h1 {
        font-size: 1.5rem;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table th,
    .table td {
        font-size: 0.8rem;
        padding: 0.5rem 0.25rem;
    }
    
    .table .actions {
        min-width: 120px;
    }
    
    .btn-small {
        font-size: 0.7rem;
        padding: 0.375rem 0.5rem;
    }
    
    .shift-card-compact {
        padding: 0.5rem;
    }
    
    .shift-card-compact .shift-time {
        font-size: 0.9rem;
    }
    
    .btn-compact {
        padding: 0.4rem 0.65rem;
        font-size: 0.8rem;
    }
    
    .pwa-update-notification {
        left: 10px;
        right: 10px;
        transform: none;
        min-width: auto;
        top: 70px;
        padding: 0.75rem 1rem;
    }
    
    /* Profile tabs mobile */
    .profile-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-button {
        flex-shrink: 0;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .profile-form {
        padding: 1.5rem;
    }
}

/* =========================================
   Modal Styles
   ========================================= */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: modalSlideIn 0.3s ease-out;
}

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

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

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.modal-close {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.shift-details-box {
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.shift-details-box p {
    margin: 0.25rem 0;
}

.shift-details-box .spots-available {
    color: var(--success-color);
    font-weight: 600;
    margin-top: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.spots-counter {
    background: #e0f2fe;
    border: 1px solid #7dd3fc;
    border-radius: 6px;
    padding: 0.75rem;
    margin: 1rem 0;
    text-align: center;
}

.spots-counter p {
    margin: 0;
    color: var(--primary-dark);
}

/* Friend Forms */
.friend-form {
    background: var(--light-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    position: relative;
}

.friend-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.friend-form-header h4 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.btn-remove-friend {
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.btn-remove-friend:hover {
    background: #dc2626;
}

.phone-input-group {
    display: flex;
    gap: 0.5rem;
}

.country-code-select {
    flex: 0 0 120px;
}

.phone-number-input {
    flex: 1;
}

.shift-context-box {
    background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
    border: 2px solid #5B8FE8;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.shift-context-box h3 {
    margin: 0 0 0.75rem 0;
    color: var(--primary-dark);
    font-size: 1.1rem;
}

.shift-context-box p {
    margin: 0.25rem 0;
    color: var(--text-primary);
}

.shift-context-box strong {
    color: var(--primary-color);
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-actions {
        flex-direction: column-reverse;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
}
