@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    /* Color Palette - Warm Dark */
    --bg-dark: #121212;
    --bg-card: #1e1e1e;
    --bg-card-glass: rgba(30, 30, 30, 0.6);

    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;

    /* Brand Accents - Warm Orange/Gold */
    --primary: #ff7e5f;
    --primary-gradient: linear-gradient(135deg, #ff7e5f 0%, #feb47b 100%);
    --secondary: #feb47b;
    --accent-glow: rgba(255, 126, 95, 0.4);

    /* Borders & Separators */
    --border: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 126, 95, 0.5);

    /* Functional Colors */
    --success: #00b894;
    --danger: #d63031;
    --warning: #fdcb6e;
    --info: #0984e3;

    /* Spacing */
    --container-width: 1200px;
    --header-height: 80px;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

[data-theme="light"] {
    --bg-dark: #f8f9fa;
    --bg-card: #ffffff;
    --bg-card-glass: rgba(255, 255, 255, 0.7);
    --text-main: #2d3436;
    --text-muted: #636e72;
    --border: rgba(0, 0, 0, 0.08);
    --accent-glow: rgba(255, 126, 95, 0.2);
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
    border-radius: var(--radius-sm);
}

/* Layout Utilities */
.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}


/* Sections */
section {
    padding: 120px 0;
    position: relative;
    overflow: hidden;
}

.section-header {
    margin-bottom: 60px;
    text-align: center;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 16px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Stats */
.stat-item {
    text-align: center;
    padding: 30px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition-smooth);
}

.stat-item:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}

.stat-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Grid System */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 992px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    section {
        padding: 60px 0;
    }
}

/* Glassmorphism Classes */
.glass {
    background: var(--bg-card-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 28px;
    border-radius: 50px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: var(--transition-smooth);
    padding: 20px 0;
}

.navbar.scrolled {
    padding: 15px 0;
    background: rgba(18, 18, 18, 0.85);
    /* Darker on scroll */
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

[data-theme="light"] .navbar.scrolled {
    background: rgba(255, 255, 255, 0.85);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-link {
    font-weight: 500;
    position: relative;
    opacity: 0.8;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.nav-link:hover,
.nav-link.active {
    opacity: 1;
    color: var(--primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width var(--transition-fast);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    color: var(--primary);
}

.nav-icon-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.nav-icon-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(255, 126, 95, 0.1);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: var(--header-height);
    background:
        radial-gradient(circle at 15% 50%, rgba(255, 126, 95, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(254, 180, 123, 0.08), transparent 25%);
    overflow: hidden;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none;
}

.hero-content {
    max-width: 1000px;
    padding: 0 20px;
    z-index: 2;
    position: relative;
}

.hero-title {
    font-size: 4.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero-title span {
    display: inline-block;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

.hero-title span::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 100%;
    height: 15px;
    background: var(--primary);
    opacity: 0.2;
    z-index: -1;
    border-radius: 4px;
    transform: skewX(-10deg);
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 3rem;
    }

    .hero-title span::after {
        height: 10px;
        bottom: 5px;
    }
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.stagger-delay:nth-child(1) {
    transition-delay: 0.1s;
}

.stagger-delay:nth-child(2) {
    transition-delay: 0.2s;
}

.stagger-delay:nth-child(3) {
    transition-delay: 0.3s;
}

.stagger-delay:nth-child(4) {
    transition-delay: 0.4s;
}

/* Cards & Projects */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 30px;
    border: 1px solid var(--border);
    transition: var(--transition-smooth);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Iteration 4: Uniform Grid & Dual Action */
.project-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 520px;
    /* Forced fixed height */
    transition: all 0.4s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.project-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.project-image-wrapper {
    height: 240px;
    /* Takes up ~45% of card */
    width: 100%;
    flex-shrink: 0;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    position: relative;
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.project-card:hover .project-img {
    transform: scale(1.05);
}

.project-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.project-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
    /* Pushes footer down if text is short */
}

.project-tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
    min-height: 24px;
    /* Ensure space is reserved even if empty */
}

.tech-badge {
    font-size: 0.7rem;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Dual Button Footer */
.project-footer {
    margin-top: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-project-action {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
}

/* Secondary Button ("Plus d'info") */
.btn-action-info {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.btn-action-info:hover {
    border-color: var(--text-main);
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.02);
}

/* Primary Button ("Voir le site") */
.btn-action-view {
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn-action-view:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px var(--accent-glow);
}

.btn-action-disabled {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
    box-shadow: none;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
    transition: var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

/* Panel Layout (Admin/Client) */
.panel-layout {
    display: flex;
    min-height: 100vh;
}

.panel-sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--bg-card) 0%, rgba(30, 30, 30, 0.95) 100%);
    border-right: 1px solid var(--border);
    padding: 30px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    transition: transform var(--transition-smooth);
    z-index: 900;
}

.panel-main {
    flex: 1;
    margin-left: 280px;
    padding: 40px;
    background: var(--bg-dark);
    min-height: 100vh;
}

.panel-nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 8px;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.panel-nav-link:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    transform: translateX(4px);
}

.panel-nav-link.active {
    background: rgba(255, 126, 95, 0.15);
    color: var(--primary);
    border-color: rgba(255, 126, 95, 0.2);
    font-weight: 600;
}

/* Panel Toggle */
.panel-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: none;
    /* Hidden on desktop */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: var(--transition-fast);
}

.panel-toggle:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Responsive Panel */
@media (max-width: 992px) {
    .panel-toggle {
        display: flex;
    }

    .panel-sidebar {
        transform: translateX(-100%);
        box-shadow: 5px 0 30px rgba(0, 0, 0, 0.3);
    }

    .panel-sidebar.open {
        transform: translateX(0);
    }

    .panel-main {
        margin-left: 0;
        padding: 80px 20px 40px 20px;
        width: 100%;
    }
}

@media (max-width: 768px) {

    /* Chat Responsive */
    .chat-container {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 140px);
    }

    .chat-sidebar {
        width: 100%;
        height: auto;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .chat-messages {
        height: 500px;
        /* Fixed height for mobile chat area to allow scrolling */
    }

    .chat-messages-list {
        padding: 16px;
    }

    .chat-input {
        position: sticky;
        bottom: 0;
    }

    /* Typography adjustment */
    h1 {
        font-size: 2rem;
    }
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.badge-success {
    background: rgba(0, 184, 148, 0.2);
    color: #55efc4;
    border: 1px solid rgba(0, 184, 148, 0.3);
}

.badge-warning {
    background: rgba(253, 203, 110, 0.2);
    color: #ffeaa7;
    border: 1px solid rgba(253, 203, 110, 0.3);
}

.badge-danger {
    background: rgba(214, 48, 49, 0.2);
    color: #ff7675;
    border: 1px solid rgba(214, 48, 49, 0.3);
}

.badge-info {
    background: rgba(9, 132, 227, 0.2);
    color: #74b9ff;
    border: 1px solid rgba(9, 132, 227, 0.3);
}

.badge-neutral {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Reviews Grid */
.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.review-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 25px;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.review-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--border);
    transition: background 0.3s ease;
}

.review-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.15);
}

.review-card:hover::before {
    background: var(--primary);
}

.review-stars {
    color: var(--warning);
    font-size: 0.9rem;
    margin-bottom: 0;
    display: flex;
    gap: 2px;
}

.review-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-main);
    margin: 15px 0;
    flex: 1;
    font-style: italic;
    opacity: 0.9;
}

.review-author {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 20px;
    margin-top: auto;
    border-top: 1px solid var(--border);
}

.review-info h4 {
    font-size: 0.95rem;
    margin: 0;
    font-weight: 700;
}

.review-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 5px;
}

.review-actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed var(--border);
}

/* Chat */
.chat-container {
    display: flex;
    height: calc(100vh - 180px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.chat-sidebar {
    width: 300px;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    background: var(--bg-card);
}

.chat-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at center, #1a1a1a 0%, #121212 100%);
    position: relative;
}

.chat-messages-list {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-bubble {
    max-width: 65%;
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 1rem;
    position: relative;
    line-height: 1.6;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
}

.chat-bubble.sent {
    background: var(--primary-gradient);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    background-size: 200% auto;
    animation: gradientMove 3s ease infinite;
}

.chat-bubble.received {
    background: #2a2a2a;
    color: var(--text-main);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-bubble .time {
    display: block;
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 6px;
    text-align: right;
    font-weight: 500;
}

.chat-input {
    padding: 20px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 16px;
    align-items: center;
}

.chat-input .form-control {
    border-radius: 50px;
    padding-left: 24px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
}

.chat-input .btn {
    border-radius: 50%;
    width: 50px;
    height: 50px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%
    }

    50% {
        background-position: 100% 50%
    }

    100% {
        background-position: 0% 50%
    }
}

.chat-sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: var(--transition-fast);
}

.chat-sidebar-item:hover,
.chat-sidebar-item.active {
    background: rgba(255, 126, 95, 0.08);
}

.chat-sidebar-item.active {
    border-left: 3px solid var(--primary);
}

.review-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}




/* Utilities */
.text-center {
    text-align: center;
}

.mb-2 {
    margin-bottom: 20px;
}

.mt-2 {
    margin-top: 20px;
}

.w-100 {
    width: 100%;
}



.d-none {
    display: none;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.empty-state:hover {
    border-color: var(--primary);
    background: rgba(255, 126, 95, 0.05);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    color: var(--text-muted);
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1rem;
    font-weight: 500;
}

.mobile-toggle {
    display: none;
    /* Hidden on desktop */
    z-index: 1001;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 100%;
        /* Full width on mobile for better UX */
        max-width: 300px;
        /* But capped */
        background: var(--bg-card);
        flex-direction: column;
        justify-content: center;
        /* Center items */
        align-items: center;
        padding: 80px 30px;
        transform: translateX(100%);
        transition: transform var(--transition-smooth);
        border-left: 1px solid var(--border);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .nav-links li {
        width: 100%;
        text-align: center;
        margin-bottom: 20px;
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .mobile-toggle {
        display: block;
    }

    /* Hero Responsive */
    .hero-title {
        font-size: 2.2rem !important;
        /* Force resize */
    }

    .hero-subtitle {
        font-size: 1rem !important;
    }
}

/* Dashboard Extras */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.stat-number {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.4rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 1.2rem;
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary);
}

.sidebar-user-info h4 {
    font-size: 0.95rem;
    margin-bottom: 0;
}


/* Modals Redesign */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-smooth);
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal {
    background: var(--bg-card);
    width: 90%;
    max-width: 900px;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform var(--transition-smooth);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.modal-header h2 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.modal-body {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    /* Important for flex scrolling */
}

.modal-footer {
    padding: 24px 32px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    background: var(--bg-dark);
}

.project-details-modal {
    max-width: 780px;
}

.project-modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.project-modal-media {
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-dark);
}

.project-modal-image {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: 0;
}

.project-modal-description {
    color: var(--text-muted);
    line-height: 1.75;
    white-space: pre-line;
    margin: 0;
}

.project-modal-tech-block h4 {
    margin: 0 0 10px;
    font-size: 1rem;
}

.project-modal-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-modal-tech .tech-badge {
    font-size: 0.78rem;
    padding: 6px 10px;
    border-radius: 6px;
}

.project-modal-footer {
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .project-modal-footer {
        flex-wrap: wrap;
        justify-content: stretch;
    }

    .project-modal-footer .btn,
    .project-modal-footer .btn-project-action {
        width: 100%;
    }
}

/* Forms in Modals */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 126, 95, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Item Lines */
#item-lines {
    margin-bottom: 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.item-line {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.item-line:last-child {
    border-bottom: none;
}

.item-line:hover {
    background: rgba(255, 255, 255, 0.02);
}

.item-line .form-group {
    margin-bottom: 0;
}

.remove-line {
    cursor: pointer;
    color: var(--text-muted);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.remove-line:hover {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger);
}

/* Star Rating Animation */
.star-rating-form {
    display: flex;
    flex-direction: row-reverse;
    gap: 10px;
    justify-content: flex-end;
}

.star-rating-form input {
    display: none;
}

.star-rating-form label {
    cursor: pointer;
    font-size: 1.8rem;
    color: var(--border);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
}

.star-rating-form label:hover {
    transform: scale(1.2);
}

.star-rating-form input:checked~label,
.star-rating-form label:hover,
.star-rating-form label:hover~label {
    color: #fdcb6e;
    text-shadow: 0 0 10px rgba(253, 203, 110, 0.5);
}

.star-rating-form input:checked+label {
    animation: starPop 0.3s ease forwards;
}

@keyframes starPop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.4);
    }

    100% {
        transform: scale(1.2);
    }
}

/* Static Reviews Stars Improvement */
.review-stars .fas.fa-star {
    transition: transform 0.2s ease;
}

.review-card:hover .review-stars .fas.fa-star {
    animation: starPulse 1.5s infinite;
}

.review-card:hover .review-stars .fas.fa-star:nth-child(1) {
    animation-delay: 0.1s;
}

.review-card:hover .review-stars .fas.fa-star:nth-child(2) {
    animation-delay: 0.2s;
}

.review-card:hover .review-stars .fas.fa-star:nth-child(3) {
    animation-delay: 0.3s;
}

.review-card:hover .review-stars .fas.fa-star:nth-child(4) {
    animation-delay: 0.4s;
}

.review-card:hover .review-stars .fas.fa-star:nth-child(5) {
    animation-delay: 0.5s;
}

@keyframes starPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}



.document-totals {
    background: transparent;
    padding: 0;
    border: none;
    max-width: 300px;
    margin-left: auto;
    margin-top: 40px;
}

/* Document Preview (Invoices/Quotes) */
.document-preview {
    background: #ffffff;
    color: #1e293b;
    padding: 40px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

[data-theme="dark"] .document-preview {
    background: #ffffff;
    color: #1e293b;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.document-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 20px;
}

.document-header h2 {
    color: #0f172a;
}

.document-header p {
    color: #64748b;
}

.document-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    gap: 40px;
}

.document-info h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 0.05em;
}

.client-box {
    background: #f8fafc;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

[data-theme="dark"] .client-box {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.client-box p {
    color: #1e293b;
}

.client-box p:last-child {
    color: #64748b;
}

.document-items table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.document-items th {
    text-align: left;
    padding: 12px 16px;
    color: #64748b;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    border-bottom: 2px solid #e2e8f0;
}

.document-items td {
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    font-family: inherit;
    color: #334155;
}

.document-items tr:last-child td {
    border-bottom: none;
}

.document-items td:nth-child(2),
.document-items td:nth-child(3) {
    color: #64748b;
}

.document-items td:nth-child(4) {
    color: #0f172a;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    color: #64748b;
}

.total-row span:last-child {
    font-weight: 600;
    color: #0f172a;
    font-family: 'Consolas', monospace;
}

.total-row[style*="color:var(--success)"] {
    color: #22c55e !important;
}

.total-row[style*="color:var(--success)"] span {
    color: #22c55e !important;
}

.grand-total {
    border-top: 2px solid #f1f5f9;
    padding-top: 16px;
    margin-top: 16px;
    color: #0f172a;
    align-items: center;
}

.grand-total span:first-child {
    font-weight: 700;
    font-size: 1.1rem;
}

.grand-total span:last-child {
    font-weight: 800;
    color: var(--primary);
    font-size: 1.25rem;
}