/* ============================================
   CLIENT PORTAL — STYLESHEET
   ============================================
   A modern dark theme with glassmorphism effects.
   
   COLOR SYSTEM:
   - Background:  Deep navy (#0a0e1a)
   - Cards:       Glass effect (semi-transparent)
   - Primary:     Vibrant purple-blue gradient
   - Success:     Emerald green (#10b981)
   - Warning:     Amber (#f59e0b)
   - Error:       Rose red (#ef4444)
   ============================================ */

/* ---- RESET & BASE ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(255, 255, 255, 0.15);
    
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-start: #6366f1;
    --accent-end: #8b5cf6;
    --accent-glow: rgba(99, 102, 241, 0.3);
    
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.12);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.12);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--accent-glow);
    
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

main {
    flex: 1;
}

a {
    color: var(--accent-start);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-end);
}

img {
    max-width: 100%;
    display: block;
}

/* ---- CONTAINER ---- */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---- NAVIGATION ---- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 0;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary) !important;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.02em;
}

.logo-icon {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    color: var(--text-secondary) !important;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
}

.nav-link:hover {
    color: var(--text-primary) !important;
    background: var(--bg-card-hover);
}

.nav-link-logout {
    color: var(--error) !important;
}

.nav-link-logout:hover {
    background: var(--error-bg);
}

.btn-nav {
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    color: white !important;
    border-radius: var(--radius-full);
    padding: 8px 20px;
}

.btn-nav:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: all var(--transition);
}

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    color: white;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px var(--accent-glow);
    color: white;
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    color: var(--text-primary);
    border-color: var(--border-color-hover);
    background: var(--bg-card);
}

.btn-full {
    width: 100%;
}

/* ---- HERO SECTION ---- */
.hero {
    position: relative;
    padding: 120px 0 100px;
    text-align: center;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 24px;
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end), #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 540px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    opacity: 0.4;
    pointer-events: none;
    animation: pulse-glow 6s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.5; transform: translate(-50%, -50%) scale(1.1); }
}

/* ---- FEATURES SECTION ---- */
.features {
    padding: 80px 0 100px;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 48px;
    letter-spacing: -0.02em;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    text-align: center;
    transition: all var(--transition);
}

.feature-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-color-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ---- AUTH PAGES (Login / Register) ---- */
.auth-section,
.form-section {
    padding: 80px 0;
    display: flex;
    align-items: center;
    min-height: calc(100vh - 64px - 80px);
}

.auth-card,
.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    max-width: 480px;
    margin: 0 auto;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-secondary);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: all var(--transition);
    width: 100%;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-start);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ---- PROFILE AVATAR ---- */
.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    margin: 0 auto 16px;
    box-shadow: 0 4px 20px var(--accent-glow);
}

/* ---- DASHBOARD ---- */
.dashboard-section {
    padding: 48px 0 80px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.dashboard-header h1 {
    font-size: 2rem;
    font-weight: 700;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    transition: all var(--transition);
}

.stat-card:hover {
    border-color: var(--border-color-hover);
    transform: translateY(-2px);
}

.stat-number {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-new .stat-number { color: var(--info); }
.stat-progress .stat-number { color: var(--warning); }
.stat-completed .stat-number { color: var(--success); }

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 24px;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Data Table */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 14px 24px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.data-table tbody tr {
    transition: background var(--transition);
}

.data-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-new {
    color: var(--info);
    background: var(--info-bg);
}

.badge-progress {
    color: var(--warning);
    background: var(--warning-bg);
}

.badge-completed {
    color: var(--success);
    background: var(--success-bg);
}

/* ---- ALERTS ---- */
.alert {
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.alert-error {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ---- FLASH MESSAGES ---- */
.flash-message {
    padding: 14px 0;
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
    animation: slide-down 0.4s ease-out;
}

.flash-message .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flash-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.7;
    transition: opacity var(--transition);
}

.flash-close:hover {
    opacity: 1;
}

.flash-success {
    background: var(--success-bg);
    color: var(--success);
    border-bottom: 1px solid rgba(16, 185, 129, 0.2);
}

.flash-error {
    background: var(--error-bg);
    color: var(--error);
    border-bottom: 1px solid rgba(239, 68, 68, 0.2);
}

.flash-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}

.flash-info {
    background: var(--info-bg);
    color: var(--info);
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

@keyframes slide-down {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- FOOTER ---- */
.footer {
    border-top: 1px solid var(--border-color);
    padding: 24px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ---- UTILITY CLASSES ---- */
.text-muted { color: var(--text-muted); }
.text-small { font-size: 0.85rem; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
        padding: 16px;
        gap: 4px;
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .hero {
        padding: 80px 0 60px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .auth-card,
    .form-card {
        padding: 32px 24px;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .data-table th,
    .data-table td {
        padding: 12px 16px;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
