/* --- CSS/style.css --- */
/* Premium Light Theme for Dashboard and Member pages */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #4f46e5;       /* Indigo 600 */
    --secondary-color: #6366f1;     /* Indigo 500 */
    --accent-light: #e0e7ff;        /* Indigo 100 */
    --danger-color: #ef4444;        /* Red 500 */
    --success-color: #10b981;       /* Emerald 500 */
    --warning-color: #f59e0b;       /* Amber 500 */
    --bg-light: #f8fafc;            /* Slate 50 */
    --white: #ffffff;
    --text-dark: #0f172a;           /* Slate 900 */
    --text-light: #64748b;          /* Slate 500 */
    --border-color: #e2e8f0;        /* Slate 200 */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --focus-ring: rgba(79, 70, 229, 0.15);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

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

body { 
    font-family: 'Plus Jakarta Sans', sans-serif; 
    background: var(--bg-light); 
    color: var(--text-dark);
    line-height: 1.5;
    background-image: radial-gradient(at 0% 0%, rgba(224, 231, 255, 0.3) 0, transparent 50%),
                      radial-gradient(at 50% 0%, rgba(224, 242, 254, 0.3) 0, transparent 50%);
    background-attachment: fixed;
}

/* Header */
.main-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
    padding: 0 2rem;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: auto;
    min-width: 42px;
    height: 42px;
    padding: 0 10px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.72rem;
    letter-spacing: -0.2px;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.15);
}

.brand-text h1 {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.brand-text p {
    font-size: 0.72rem;
    color: var(--text-light);
    margin: 0;
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-link {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.header-link:hover {
    background: var(--accent-light);
    color: var(--primary-color);
}

.header-link.logout {
    color: var(--danger-color);
    background: #fef2f2;
}

.header-link.logout:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Notifications */
.notif-btn {
    position: relative;
    background: #f1f5f9;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-dark);
    padding: 10px;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger-color);
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 50px;
    font-weight: 700;
    border: 2px solid var(--white);
}

.notif-dropdown {
    position: absolute;
    top: 60px;
    right: 0;
    width: 360px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    z-index: 200;
    border: 1px solid var(--border-color);
    overflow: hidden;
    animation: scaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.notif-dropdown.active {
    display: flex;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.notif-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    color: var(--text-dark);
    font-size: 0.95rem;
    background: #fafafa;
}

.notif-item {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.2s;
}

.notif-item:hover {
    background: #f8fafc;
}

/* Dashboard Layout */
.dashboard-container {
    max-width: 1200px;
    margin: 2.5rem auto;
    padding: 0 1.5rem;
}

.table-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.toolbar {
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: #fafafa;
}

.toolbar h3 {
    color: var(--text-dark);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f8fafc;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-light);
    text-align: left;
}

th {
    padding: 16px 20px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
}

tbody tr {
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.2s ease;
}

tbody tr:hover {
    background: #f8fafc;
}

td {
    padding: 16px 20px;
    font-size: 0.92rem;
    vertical-align: middle;
    color: var(--text-dark);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-cell img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.25s ease-out;
}

.modal-card {
    background: var(--white);
    width: 600px;
    max-width: 95%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.4px;
}

.modal-close {
    background: #f1f5f9;
    border: none;
    color: var(--text-light);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--accent-light);
    color: var(--primary-color);
}

.modal-body {
    padding: 2rem;
    max-height: 75vh;
    overflow-y: auto;
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}
.modal-body::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 10px;
}

.modal-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-dark);
}

.modal-form input, 
.modal-form select {
    width: 100%;
    margin-bottom: 16px;
    padding: 11px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-sizing: border-box;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.25s;
}

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

/* Badges */
.badge {
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-success {
    background: #e6fffa;
    color: #047857;
}

.badge-danger {
    background: #fef2f2;
    color: #b91c1c;
}

.badge-warning {
    background: #fffbeb;
    color: #b45309;
}

/* Profile & Utilities */
.profile-top {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    align-items: center;
}

.profile-top img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--accent-light);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    object-fit: cover;
}

.profile-top h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}

.profile-top p {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.info-box {
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.info-box label {
    font-size: 0.75rem;
    color: var(--text-light);
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
}

.info-box p {
    margin: 0;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.action-divider {
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
    padding-top: 20px;
}

.action-divider h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 12px;
}

/* Toast */
.toast {
    visibility: hidden;
    min-width: 300px;
    background-color: var(--text-dark);
    color: #fff;
    text-align: center;
    border-radius: var(--radius-md);
    padding: 16px 24px;
    position: fixed;
    z-index: 9999;
    left: 50%;
    transform: translateX(-50%);
    bottom: 30px;
    box-shadow: var(--shadow-lg);
    font-weight: 600;
    font-size: 0.92rem;
    transition: visibility 0s, opacity 0.3s ease-out, transform 0.3s ease-out;
    opacity: 0;
}

.toast.show {
    visibility: visible;
    opacity: 1;
    animation: toastFadeIn 0.3s ease-out forwards;
}

@keyframes toastFadeIn {
    from { bottom: 15px; opacity: 0; }
    to { bottom: 30px; opacity: 1; }
}

/* Floating Actions */
.support-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
}

.support-fab a {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.92rem;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
    transition: all 0.2s ease;
}

.support-fab a:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -3px rgba(79, 70, 229, 0.4);
}

.chk-box {
    width: 18px;
    height: 18px;
    cursor: pointer;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.filters {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-family: inherit;
    font-weight: 600;
    color: var(--text-light);
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-select:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    gap: 6px;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.15);
}

.btn-primary:hover {
    box-shadow: 0 6px 14px rgba(79, 70, 229, 0.25);
    opacity: 0.95;
}

.btn-success {
    background: var(--success-color);
    color: white;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.15);
}

.btn-success:hover {
    box-shadow: 0 6px 14px rgba(16, 185, 129, 0.25);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.15);
}

.btn-danger:hover {
    box-shadow: 0 6px 14px rgba(239, 68, 68, 0.25);
}

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

.btn-outline:hover {
    background: var(--accent-light);
}

.btn-info {
    background: #3b82f6;
    color: white;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.15);
}

.btn-info:hover {
    box-shadow: 0 6px 14px rgba(59, 130, 246, 0.25);
}

.btn-warning {
    background: var(--warning-color);
    color: white;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.15);
}

.btn-warning:hover {
    box-shadow: 0 6px 14px rgba(245, 158, 11, 0.25);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ============================================================
   Mobile responsiveness
   ============================================================ */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 900px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 768px) {
    .main-header { padding: 10px 1rem; height: auto; min-height: 62px; flex-wrap: wrap; gap: 10px; }
    .brand-text p { display: none; }
    .header-link { padding: 8px 12px; font-size: 0.85rem; }

    .dashboard-container { padding: 0 0.85rem; margin: 1.25rem auto; }

    .toolbar { padding: 1rem 1.1rem; flex-direction: column; align-items: stretch; }
    .toolbar > div { width: 100%; }
    .filters { width: 100%; }
    .filters input, .filters select { flex: 1 1 auto; min-width: 0; }

    table { min-width: 640px; }

    .modal-card { width: 94%; max-height: 88vh; }
    .modal-header { padding: 1.1rem 1.25rem; }
    .modal-body { padding: 1.25rem; max-height: 78vh; }

    .info-grid { grid-template-columns: 1fr; }

    .notif-dropdown { width: min(360px, 92vw); right: -8px; }

    .profile-top { flex-direction: column; text-align: center; }

    .action-divider div[style*="display:flex"] { justify-content: center; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr !important; }
    .brand-logo { width: 36px; height: 36px; font-size: 1rem; }
    .brand-text h1 { font-size: 1.05rem; }
    .support-fab a span, .support-fab a { font-size: 0.85rem; padding: 10px 18px; }
    .btn-sm { padding: 6px 10px; font-size: 0.76rem; }
}
