/* assets/css/style.css - Main Stylesheet */

:root {
    /* Colors - Light Theme (Default) */
    --bg-color: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --card-bg: rgba(255, 255, 255, 0.6);
    --border-color: rgba(0, 0, 0, 0.05);
    --primary-color: #3b82f6;
    /* Blue */
    --primary-hover: #2563eb;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --input-bg: rgba(255, 255, 255, 0.8);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* .dark {
    --bg-color: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --input-bg: rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
} */

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Optional: subtle background pattern/gradient */
    background-image: radial-gradient(circle at top right, rgba(59, 130, 246, 0.1) 0%, transparent 40%),
        radial-gradient(circle at bottom left, rgba(99, 102, 241, 0.1) 0%, transparent 40%);
    background-attachment: fixed;
}

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

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

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

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

/* Glassmorphism Cards */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    padding: 2rem;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    text-align: center;
    white-space: nowrap;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.4);
}

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

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

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.dark .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.btn-block {
    display: block;
    width: 100%;
}

/* Auth Layout (Centered content) */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 120px);
    /* minus header/footer approximate height */
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 450px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo h1 {
    font-size: 1.75rem;
    margin-bottom: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, #a855f7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Alerts / Toasts */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    display: flex;
    align-items: center;
    min-width: 300px;
    padding: 1rem;
    margin-top: 0.5rem;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--danger-color);
}

.toast.warning {
    border-left-color: var(--warning-color);
}

/* Responsive grid */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.w-full {
    width: 100%;
}

.d-flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.d-none {
    display: none !important;
}

/* Table Wrapper for Mobile */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    box-shadow: inset 0 0 0 1px var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

th,
td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

/* Base Mobile Overrides */
@media (max-width: 768px) {
    .container {
        padding: 0 0.5rem;
    }

    .glass-card {
        padding: 1.25rem;
    }

    .grid-cols-2 {
        grid-template-columns: 1fr;
    }

    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .btn:last-child {
        margin-bottom: 0;
    }

    .d-md-flex {
        display: none !important;
    }

    .d-md-block {
        display: none !important;
    }

    .mobile-flex-col {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .auth-wrapper {
        padding: 1rem 0.5rem;
    }
}

/* Desktop Utilities */
@media (min-width: 769px) {
    .d-mobile-only {
        display: none !important;
    }
}

/* ═══════ Pagination ═══════ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-top: 1.25rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.pagination-info {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: 'Inter', sans-serif;
}

.pagination-btn:hover:not(.disabled):not(.active) {
    background: rgba(99, 102, 241, 0.08);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    font-weight: 600;
}

.pagination-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 36px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

@media (max-width: 600px) {
    .pagination {
        justify-content: center;
    }

    .pagination-info {
        width: 100%;
        text-align: center;
    }
}
/* ═══════ Validation & Modal ═══════ */

/* Validation Feedback */
.input-valid {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}
.input-invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}
.text-danger { color: #ef4444 !important; }
.text-success { color: #10b981 !important; }

/* PDPA Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 1rem;
}

.modal-content {
    background: var(--bg-color);
    width: 100%;
    max-width: 700px;
    max-height: 85vh;
    padding: 2.5rem;
    border-radius: 1.5rem;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
}

.pdpa-text {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--text-primary);
}

.pdpa-text h3 { 
    margin-bottom: 1.25rem; 
    color: var(--primary-color);
    font-size: 1.5rem;
}
.pdpa-text h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
}
.pdpa-text p { margin-bottom: 1rem; }
.pdpa-text ul { margin-bottom: 1.25rem; padding-left: 1.5rem; }
.pdpa-text li { margin-bottom: 0.5rem; }

/* Form Helper */
.relative { position: relative; }
.absolute-right { 
    position: absolute; 
    right: 12px; 
    top: 50%; 
    transform: translateY(-50%); 
    pointer-events: none;
}

/* --- Redesigned Navbar & Footer --- */

/* Navbar enhancements */
.navbar {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    position: relative;
    text-decoration: none;
}

.nav-link:hover {
    color: var(--primary-color);
    background: rgba(59, 130, 246, 0.05);
}

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

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0.75rem;
    right: 0.75rem;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px 3px 0 0;
}

/* User Pill */
.nav-user-pill {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.75rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
}

.nav-user-pill:hover {
    border-color: var(--primary-color);
    background: white;
    box-shadow: var(--shadow-md);
}

.nav-user-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    overflow: hidden;
}

.nav-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Admin Badge */
.nav-badge-admin {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(245, 158, 11, 0.2);
    margin-right: 0.5rem;
}

/* Notifications */
.nav-notification-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    position: relative;
}

.nav-notification-btn:hover {
    color: var(--primary-color);
    background: rgba(59, 130, 246, 0.05);
}

/* Footer redesign */
.footer {
    background: white;
    border-top: 1px solid var(--border-color);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

.footer-brand h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-top: 0;
}

.footer-brand p {
    color: var(--text-secondary);
    max-width: 300px;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.footer-heading {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    transition: color 0.2s;
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-contact-item {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    .nav-link.active::after {
        display: none;
    }
}

/* --- Premium Auth Components --- */

.auth-card-wide {
    max-width: 600px;
}

/* Segmented Toggle Control */
.mode-toggle {
    display: flex;
    background: rgba(0, 0, 0, 0.05);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.mode-toggle-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-toggle-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Input Icon Group */
.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper .form-control {
    padding-left: 2.75rem;
}

.input-icon-leading {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Auth Error Alert (Premium) */
.auth-error-alert {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--danger-color);
    font-size: 0.9375rem;
    font-weight: 500;
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* Step Indicator */
.step-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    position: relative;
    padding: 0 1rem;
}

.step-indicator::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 2rem;
    right: 2rem;
    height: 2px;
    background: var(--border-color);
    z-index: 1;
}

.step-indicator-item {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.step-number {
    width: 36px;
    height: 36px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.step-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.step-indicator-item.active .step-number {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.step-indicator-item.active .step-label {
    color: var(--primary-color);
}

.step-indicator-item.completed .step-number {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.step-indicator-item.completed .step-label {
    color: var(--success-color);
}

/* Form Sections */
.form-section-header {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

/* OTP Input Boxes */
.otp-container {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.otp-box {
    width: 45px;
    height: 55px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--input-bg);
    transition: all 0.2s ease;
}

.otp-box:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    outline: none;
}

/* Password Strength Meter */
.strength-meter {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
    position: relative;
}

.strength-bar {
    height: 100%;
    width: 0;
    transition: all 0.3s ease;
}

.strength-bar.weak { width: 33.33%; background-color: var(--danger-color); }
.strength-bar.medium { width: 66.66%; background-color: var(--warning-color); }
.strength-bar.strong { width: 100%; background-color: var(--success-color); }

.strength-text {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.25rem;
    display: block;
}

/* Registration Summary Card (Premium) */
.reg-summary-card {
    background: rgba(59, 130, 246, 0.03);
    border: 1px dashed var(--primary-color);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 2rem;
}

.reg-summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.reg-summary-label { color: var(--text-secondary); }
.reg-summary-value { font-weight: 600; color: var(--text-primary); }
