/* === Marmura Modern Design System === */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Primary palette */
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --primary-light: #EEF2FF;
    --primary-dark: #3730A3;

    /* Accent */
    --accent: #06B6D4;
    --accent-light: #ECFEFF;

    /* Semantic colors */
    --success: #10B981;
    --success-light: #ECFDF5;
    --warning: #F59E0B;
    --warning-light: #FFFBEB;
    --danger: #EF4444;
    --danger-light: #FEF2F2;
    --info: #06B6D4;
    --info-light: #ECFEFF;

    /* Neutral palette */
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;

    /* Layout */
    --navbar-height: 64px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.04);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.07), 0 4px 6px -4px rgba(0,0,0,0.04);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.07), 0 8px 10px -6px rgba(0,0,0,0.04);
}

/* === Base === */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* === Override Bootstrap primary color === */
.btn-primary {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 1px 3px rgba(79,70,229,0.25);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    box-shadow: 0 4px 10px rgba(79,70,229,0.3);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.btn-outline-primary:hover {
    background-color: var(--primary) !important;
    color: white !important;
}

.text-primary { color: var(--primary) !important; }
.bg-primary { background-color: var(--primary) !important; }
.border-primary { border-color: var(--primary) !important; }

/* === Navbar === */
.navbar {
    height: var(--navbar-height);
    background: white !important;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    padding: 0 1rem;
}

.navbar-brand {
    font-weight: 700;
    color: var(--gray-900) !important;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(79,70,229,0.35);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--gray-900);
}

.brand-subtitle {
    font-size: 0.7rem;
    color: var(--gray-500);
    font-weight: 400;
}

.navbar-toggler {
    border: none;
    padding: 0.375rem;
    color: var(--gray-600);
    border-radius: var(--border-radius-sm);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(79,70,229,0.15);
}

.navbar-nav .nav-link {
    color: var(--gray-600) !important;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem !important;
    border-radius: var(--border-radius-sm);
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--primary) !important;
    background-color: var(--primary-light);
}

.navbar-nav .nav-link i {
    font-size: 1rem;
    flex-shrink: 0;
}

.dropdown-menu {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 0.5rem;
    min-width: 210px;
    margin-top: 0.375rem !important;
    animation: dropdownFade 0.15s ease;
}

@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.12s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--primary-light);
    color: var(--primary);
}

.dropdown-divider {
    margin: 0.375rem 0;
    border-color: var(--gray-200);
}

/* User button */
.user-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* === Mobile Bottom Navigation === */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--gray-200);
    padding: 0.25rem 0.5rem;
    z-index: 1030;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
}

.mobile-bottom-nav .nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.mobile-bottom-nav a.nav-item-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    padding: 0.4rem 0.5rem;
    border-radius: var(--border-radius-sm);
    color: var(--gray-500);
    text-decoration: none;
    font-size: 0.625rem;
    font-weight: 500;
    min-width: 52px;
    transition: all 0.15s ease;
}

.mobile-bottom-nav a.nav-item-link i {
    font-size: 1.35rem;
}

.mobile-bottom-nav a.nav-item-link:hover,
.mobile-bottom-nav a.nav-item-link.active {
    color: var(--primary);
    background-color: var(--primary-light);
}

@media (max-width: 991px) {
    .mobile-bottom-nav {
        display: block;
    }

    main.container {
        padding-bottom: 80px !important;
    }

    /* Hide hamburger and collapsed nav — bottom nav is used instead */
    .navbar-toggler {
        display: none !important;
    }

    .navbar-collapse {
        display: none !important;
    }
}

/* === Page header === */
.page-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-header-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-header-title i {
    color: var(--primary);
}

/* === Cards === */
.card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--gray-100);
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.95rem;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
    padding: 0.75rem 1.25rem;
}

/* Prevent hover lift on non-interactive cards */
.card.no-hover:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
}

/* === Dashboard Stat Cards === */
.stat-card {
    border: none !important;
    border-radius: var(--border-radius-lg) !important;
    padding: 1.5rem !important;
    text-decoration: none;
    color: white !important;
    transition: all 0.22s ease !important;
    display: block;
    box-shadow: var(--shadow) !important;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 120px;
    height: 120px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: var(--shadow-lg) !important;
    color: white !important;
}

.stat-card-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.stat-card .stat-content {
    flex: 1;
    min-width: 0;
}

.stat-card .stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    opacity: 0.8;
    margin-bottom: 0.125rem;
}

.stat-card .stat-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.stat-card .stat-link-text {
    font-size: 0.78rem;
    opacity: 0.8;
    margin-top: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-card-primary  { background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%); }
.stat-card-success  { background: linear-gradient(135deg, #10B981 0%, #059669 100%); }
.stat-card-info     { background: linear-gradient(135deg, #06B6D4 0%, #0284C7 100%); }
.stat-card-warning  { background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%); }

/* === Admin section cards === */
.admin-card {
    transition: all 0.2s ease;
}

.admin-card:hover {
    box-shadow: var(--shadow-md) !important;
    transform: translateY(-2px);
}

.admin-card .card-body {
    padding: 1.5rem;
}

.admin-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background-color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.25rem;
    margin-bottom: 0.875rem;
}

/* === Buttons === */
.btn {
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: var(--border-radius);
}

/* === Tables === */
.table {
    --bs-table-hover-bg: var(--gray-50);
    margin-bottom: 0;
}

.table th {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    border-bottom: 2px solid var(--gray-200) !important;
    padding: 0.75rem 1rem;
    white-space: nowrap;
    background: var(--gray-50);
}

.table td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    color: var(--gray-700);
    border-color: var(--gray-100);
}

.table-responsive {
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

/* === Forms === */
.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
}

.form-control,
.form-select {
    border-color: var(--gray-300);
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 0.875rem;
    font-size: 0.9375rem;
    color: var(--gray-800);
    background-color: white;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
    outline: none;
}

.form-text {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.form-control-lg,
.form-select-lg {
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
}

/* === Badges === */
.badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.3em 0.65em;
    border-radius: 6px;
    letter-spacing: 0.2px;
}

/* === Alerts === */
.alert {
    border-radius: var(--border-radius);
    border: none;
    padding: 0.875rem 1.25rem;
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.alert i {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.alert-success {
    background-color: var(--success-light);
    color: #065F46;
}

.alert-danger {
    background-color: var(--danger-light);
    color: #991B1B;
}

.alert-warning {
    background-color: var(--warning-light);
    color: #92400E;
}

.alert-info {
    background-color: var(--accent-light);
    color: #164E63;
}

/* === Landing page === */
.hero-section {
    text-align: center;
    padding: 4rem 1rem 3rem;
}

.hero-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    color: white;
    margin: 0 auto 1.5rem;
    box-shadow: 0 8px 24px rgba(79,70,229,0.35);
}

.hero-section h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.75rem;
}

.hero-section .lead {
    color: var(--gray-500);
    font-size: 1.05rem;
    max-width: 480px;
    margin: 0 auto 2rem;
}

.feature-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
    background: white;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    height: 100%;
}

.feature-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.feature-card .feature-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin: 0 auto 1rem;
}

.feature-card h5 {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin: 0;
}

/* === Section titles === */
.section-heading {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.section-heading::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
    margin-left: 0.5rem;
}

/* === Empty state === */
.empty-state {
    text-align: center;
    padding: 3.5rem 1rem;
    color: var(--gray-400);
}

.empty-state i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 0.9375rem;
    color: var(--gray-500);
}

/* === Progress bars === */
.progress {
    border-radius: 99px;
    background-color: var(--gray-200);
    overflow: visible;
    height: 6px;
}

.progress-bar {
    border-radius: 99px;
    background-color: var(--primary);
    position: relative;
}

/* === List groups === */
.list-group-item {
    border-color: var(--gray-200);
    padding: 0.875rem 1.25rem;
    color: var(--gray-700);
}

.list-group-item.active {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* === Footer === */
.footer {
    background: white;
    border-top: 1px solid var(--gray-200);
    padding: 1rem;
    text-align: center;
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-top: auto;
}

/* === Voting buttons - mobile friendly === */
@media (max-width: 576px) {
    .btn-group-vertical .btn {
        padding: 1.5rem;
        font-size: 1.25rem;
    }

    .voting-code {
        font-size: 3rem !important;
        letter-spacing: 0.5rem !important;
    }
}

/* === Spinner === */
.spinner-border {
    width: 1.5rem;
    height: 1.5rem;
}

/* === Assembly questions scrollable list === */
.questions-scroll {
    max-height: 480px;
    overflow-y: auto;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.questions-scroll .list-group-item:last-child {
    border-bottom: none;
}

/* === Calendar slots === */
.calendar-slot {
    min-height: 120px;
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* === Print === */
@media print {
    .navbar, .footer, .btn, form, .mobile-bottom-nav {
        display: none !important;
    }

    body {
        background: white;
    }

    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        transform: none !important;
    }
}
