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

:root {
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444, #dc2626);
    /* Glass Effect */
    --glass-white: rgba(239, 239, 239, 0.1);
    --glass-white-strong: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.18);
    /* Light Theme */
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.95);
    --navbar-bg: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-color: rgba(226, 232, 240, 0.8);
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.16);
    --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 40px rgba(102, 126, 234, 0.4);
    --shadow-glow-pink: 0 0 40px rgba(240, 147, 251, 0.4);
    /* Colors */
    --accent: #667eea;
    --accent-hover: #5a67d8;
    --accent-light: rgba(102, 126, 234, 0.1);
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.1);
    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    /* Blur */
    --blur-md: blur(16px);
    --blur-lg: blur(24px);
}

[data-theme="dark"] {
    --bg-primary: #0a0a0f;
    --bg-secondary: #16161d;
    --bg-card: rgba(26, 26, 38, 0.95);
    --navbar-bg: #16161d;
    --text-primary: #f7fafc;
    --text-secondary: #cbd5e0;
    --text-muted: #a0aec0;
    --border-color: rgba(74, 85, 104, 0.4);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.7);
    --glass-white: rgba(255, 255, 255, 0.05);
    --glass-white-strong: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.1);
}


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

html {
    /* scroll-behavior: smooth; */
    /* overflow-x: hidden; */
    scroll-behavior: smooth;
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
}

body {
    /* font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; background: var(--bg-primary); color: var(--text-primary); line-height: 1.6; transition: background var(--transition-base), color var(--transition-base); overflow-x: hidden; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.5s ease, color 0.5s ease;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body,
.navbar,
.sidebar,
.chat-header,
.message-content,
.project-card {
    transition: background-color 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease, color 0.3s ease;
}

/* Prevent transition on page load */
.preload * {
    transition: none !important;
}

::selection {
    background: var(--accent);
    color: white;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

/* ============================================ ANIMATIONS ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes gradientAnimation {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes typingDot {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.7;
    }

    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

@keyframes themeIconRotate {
    from {
        transform: rotateY(0deg);
    }

    to {
        transform: rotateY(360deg);
    }
}

.theme-icon{
    font-size: clamp(18px, 3vw, 22px);
}

.theme-icon-rotating {
    animation: themeIconRotate 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ============================================ NAVBAR ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--navbar-bg);
    border-bottom: 1px solid var(--border-color);
    padding: clamp(12px, 2vw, 16px) 0;
    z-index: 1000;
    box-shadow: var(--shadow);
    transform: translateY(0);
    transition: all var(--transition-base);
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 clamp(16px, 3vw, 24px);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: clamp(12px, 2vw, 16px);
}

.nav-left .logo-icon {
    width: clamp(48px, 4vw, 56px);
    height: clamp(48px, 4vw, 56px);
    /* animation: float 3s ease-in-out infinite; */
}

.nav-left h1 {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(18px, 3vw, 24px);
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.theme-toggle,
.hamburger-btn {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    width: clamp(48px, 8vw, 48px);
    height: clamp(48px, 8vw, 48px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

.theme-toggle:hover,
.hamburger-btn:hover {
    border-color: var(--accent);
    transform: scale(1.05);
}

.hamburger-btn {
    flex-direction: column;
    gap: 5px;
    padding: 12px;
}

.hamburger-line {
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-base);
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    flex-direction: column;
    gap: 12px;
    background: var(--glass-white-strong);
    backdrop-filter: var(--blur-md);
    border-top: 1px solid var(--glass-border);
    padding: 16px;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-base);
}

.mobile-menu.active {
    display: flex;
    max-height: 600px;
}

.mobile-nav-button,
.nav-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: clamp(12px, 2vw, 14px) clamp(14px, 2.5vw, 16px);
    background: transparent;
    border: 2px solid transparent;
    border-radius: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: clamp(14px, 2vw, 15px);
    font-weight: 600;
    transition: all var(--transition-base);
    text-align: left;
    width: 100%;
}

.mobile-nav-button:hover,
.nav-button:hover {
    background: var(--accent-light);
    color: var(--accent);
    transform: translateX(4px);
}

.mobile-nav-button.active,
.nav-button.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

.mobile-account {
    border-top: 1px solid var(--border-color);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-account-name,
.account-name {
    font-size: clamp(13px, 2vw, 14px);
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

.mobile-logout-btn,
.logout-btn-sidebar {
    display: block;
    width: 100%;
    padding: clamp(10px, 2vw, 12px) 16px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 12px;
    text-decoration: none;
    font-size: clamp(12px, 2vw, 13px);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    text-align: center;
    box-shadow: var(--shadow);
}

.mobile-logout-btn:hover,
.logout-btn-sidebar:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ============================================ SIDEBAR ============================================ */
.sidebar {
    width: 280px;
    background: var(--glass-white-strong);
    /* background:whitesmoke; */
    backdrop-filter: var(--blur-md);
    border-right: 1px solid var(--glass-border);
    padding: 24px 0;
    padding-top: 96px;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    /* overflow-y: auto; */
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-base), opacity var(--transition-base);
    z-index: 999;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* background: rgba(0, 0, 0, 0.5); */
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
    z-index: 998;
    cursor: pointer;
    pointer-events: none;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.sidebar.hidden {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 16px;
    margin-top: 32px;
    flex: 1;
}

.sidebar-account {
    border-top: 1px solid var(--border-color);
    padding: 20px 16px;
}

.account-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* ============================================ MAIN LAYOUT ============================================ */
.main-container {
    display: flex;
    min-height: calc(100vh - 80px);
    max-width: 1400px;
    margin: 80px auto 0;
    transition: margin-left var(--transition-base);
}

.main-container.sidebar-visible {
    margin-left: 280px;
}

.content-area {
    flex: 1;
    padding: clamp(24px, 4vw, 40px) clamp(20px, 3vw, 36px);
    /* overflow-y: auto; */
    background: var(--bg-primary);
}

/* Remove content-area padding when in chat */
.content-area:has(#chat-detail-section.active) {
    padding: 0 !important;
}

/* Direct targeting */
#chat-detail-section.active {
    margin: 0 !important;
    padding: 0 !important;
}

#chat-detail-section.active .chat-page {
    margin: 0 !important;
    padding: 0 !important;
}

/* .chat-page~.content-area,
.chat-page .content-area {
    overflow: hidden !important;
} */

#chat-detail-section.active {
    height: calc(100vh - 80px);
}

#chat-detail-section.active .chat-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}


.page-section {
    display: none;
    animation: fadeInUp 0.5s var(--transition-base);
}

.page-section.active {
    display: block;
}

.page-header {
    text-align: center;
    margin-bottom: clamp(32px, 5vw, 48px);
}

.page-header h2 {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 700;
    /* margin-bottom: 12px; */
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: clamp(15px, 2.5vw, 18px);
    font-weight: 500;
    display: none;
}

/* ============================================ SEARCH & FILTERS ============================================ */
.search-filter-container {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 150px;
    max-width: 400px;
}

.search-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: clamp(12px, 2vw, 14px) clamp(14px, 2.5vw, 16px) clamp(12px, 2vw, 14px) clamp(40px, 7vw, 48px);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: clamp(14px, 2vw, 15px);
    font-family: 'Inter', sans-serif;
    transition: all var(--transition-base);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: clamp(12px, 2vw, 14px) clamp(16px, 3vw, 20px);
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: clamp(14px, 2vw, 15px);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: var(--accent);
    background: var(--accent-light);
    transform: translateY(-2px);
}

/* ============================================ FILTER MODAL ============================================ */
.filter-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.filter-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.filter-modal {
    background: var(--bg-card);
    border-radius: 20px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: all var(--transition-base);
}

.filter-modal-overlay.active .filter-modal {
    transform: scale(1) translateY(0);
}

.filter-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(20px, 3vw, 24px);
    border-bottom: 2px solid var(--border-color);
}

.filter-modal-header h3 {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(18px, 3vw, 22px);
    font-weight: 700;
    color: var(--text-primary);
}

.filter-close-btn,
.close-preview-btn {
    width: clamp(28px, 5vw, 32px);
    height: clamp(28px, 5vw, 32px);
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.filter-close-btn:hover,
.close-preview-btn:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    transform: rotate(90deg);
}

.filter-modal-content {
    padding: clamp(20px, 3vw, 24px);
}

.filter-group,
.form-group {
    margin-bottom: clamp(16px, 3vw, 24px);
}

.filter-group:last-child,
.form-group:last-child {
    margin-bottom: 0;
}

.filter-group label,
.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: clamp(13px, 2vw, 14px);
}

.filter-group select,
.form-group select,
.form-group input,
.form-group textarea {
    width: 100%;
    padding: clamp(10px, 2vw, 12px) clamp(14px, 2.5vw, 16px);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: clamp(14px, 2vw, 15px);
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all var(--transition-base);
}

.filter-group select:focus,
.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.filter-modal-actions,
.preview-actions {
    padding: clamp(20px, 3vw, 24px);
    border-top: 2px solid var(--border-color);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-clear-btn,
.filter-apply-btn,
.edit-btn,
.save-btn,
.regenerate-btn,
.cancel-btn,
.generate-btn {
    flex: 1;
    padding: clamp(10px, 2vw, 12px) clamp(20px, 3vw, 24px);
    border-radius: 12px;
    font-size: clamp(13px, 2vw, 14px);
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-base);
    border: 2px solid var(--border-color);
    min-width: 100px;
}

.filter-clear-btn,
.cancel-btn,
.edit-btn {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.filter-apply-btn,
.regenerate-btn {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow);
}

.save-btn,
.generate-btn {
    background: var(--gradient-success);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow);
    width: 100%;
}

.filter-clear-btn:hover,
.cancel-btn:hover,
.edit-btn:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.filter-apply-btn:hover,
.save-btn:hover,
.regenerate-btn:hover,
.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.generate-btn:disabled,
.save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================ PROJECT CARDS ============================================ */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: clamp(20px, 3vw, 28px);
}

.project-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: clamp(20px, 3vw, 28px);
    border: 2px solid var(--border-color);
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.project-card:hover::before {
    transform: scaleX(1);
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.project-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

/* .project-icon { font-size: 48px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; background: linear-gradient(135deg, var(--accent-light), rgba(240, 147, 251, 0.1)); border-radius: 14px; border: 2px solid var(--accent); box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2); } */
.project-summary {
    flex: 1;
    min-width: 0;
}

.project-summary h3 {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(16px, 2.5vw, 20px);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.project-badges {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.project-type-badge,
.contributed-badge {
    padding: clamp(3px, 1vw, 4px) clamp(10px, 2vw, 12px);
    color: white;
    border-radius: 12px;
    font-size: clamp(10px, 1.5vw, 11px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-type-badge,
.project-type-badge-small {
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.contributed-badge {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    box-shadow: 0 2px 8px rgba(240, 147, 251, 0.3);
    cursor: help;
    position: relative;
}

.contributed-badge::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
    z-index: 1000;
}

.contributed-badge:hover::after {
    opacity: 1;
}

.project-section {
    margin-bottom: 16px;
}

.project-section h4 {
    font-size: clamp(12px, 2vw, 13px);
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-section p {
    font-size: clamp(13px, 2vw, 14px);
    color: var(--text-muted);
    line-height: 1.6;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tech-tag {
    padding: clamp(5px, 1vw, 6px) clamp(12px, 2vw, 14px);
    background: var(--gradient-primary);
    color: white;
    border-radius: 20px;
    font-size: clamp(11px, 1.5vw, 12px);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.tech-tag:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.project-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.project-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.meta-badge {
    padding: clamp(5px, 1vw, 6px) clamp(12px, 2vw, 14px);
    border-radius: 20px;
    font-size: clamp(11px, 1.5vw, 12px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.meta-badge.field {
    background: var(--accent-light);
    color: var(--accent);
}

.meta-badge.easy {
    background: var(--success-light);
    color: var(--success);
}

.meta-badge.medium {
    background: var(--warning-light);
    color: var(--warning);
}

.meta-badge.hard {
    background: var(--danger-light);
    color: var(--danger);
}

.project-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: space-between;
}

.like-btn,
.ai-btn {
    padding: clamp(8px, 1.5vw, 10px) clamp(14px, 2.5vw, 18px);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    font-size: clamp(12px, 2vw, 14px);
    font-weight: 600;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: 6px;
}

.like-btn:hover,
.ai-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.like-btn.liked {
    background: var(--gradient-secondary);
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-glow-pink);
}

.like-btn.liked:hover {
    transform: scale(1.05);
}

/* ============================================ CHAT SECTION ============================================ */

#chat-detail-section {
    display: none;
}

#chat-detail-section.active {
    display: block;
}


.chats-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chat-item {
    background: var(--bg-card);
    border-radius: 16px;
    padding: clamp(20px, 3vw, 24px);
    border: 2px solid var(--border-color);
    /* border-left: 4px solid var(--accent); */
    transition: all var(--transition-base);
    cursor: pointer;
}

.chat-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(8px);
}

.chat-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    /* margin-bottom: 12px; */
    gap: 12px;
    flex-wrap: wrap;
}

.chat-item-title {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(16px, 2.5vw, 18px);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.chat-item-date,
.chat-item-time {
    font-size: clamp(11px, 1.5vw, 12px);
    color: var(--text-muted);
    font-weight: 500;
}

.chat-item-preview {
    font-size: clamp(13px, 2vw, 14px);
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.chat-item-count {
    font-size: clamp(12px, 2vw, 13px);
    color: var(--text-secondary);
    /* margin-top: 8px; */
    font-weight: 500;
}

.chat-page {
    max-width: 100%;
    margin: 0;
    padding: 0;
    height: calc(100vh - 80px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .chat-page {
        height: calc(100vh - 70px);
    }
}

.chat-page .page-header {
    display: none !important;
}

.chat-container {
    background: transparent;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: none;
    max-width: 100%;
    margin: 0;
    padding: 0;
    width: 100%;
}

@media (max-width: 768px) {
    .chat-container {
        height: calc(100vh - 70px);
    }
}

.chat-header {
    /* background: var(--bg-card); */
    background: none;
    padding: clamp(16px, 3vw, 20px) clamp(20px, 4vw, 24px);
    /* border-bottom: 1px solid var(--border-color); */
    display: flex;
    align-items: center;
    gap: 16px;
    /* box-shadow: var(--shadow-sm); */
    position: sticky;
    top: 0;
    /* z-index: 10; */
    min-height: 72px;
    max-height: 96px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .chat-header {
        padding: 12px 16px;
        min-height: 60px;
        gap: 12px;
    }
}

.back-btn {
    padding: 8px 16px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: clamp(13px, 2vw, 14px);
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: 6px;
}

.back-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: translateX(-2px);
}

.project-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.project-info h2 {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(16px, 2.2vw, 18px);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 140px);
}

@media (max-width: 768px) {
    .project-info h2 {
        font-size: 14px;
        max-width: calc(100vw - 200px);
    }
}

.project-field {
    font-size: clamp(12px, 2vw, 13px);
    color: var(--text-muted);
    font-weight: 500;
}

.chat-messages {
    flex: 1;
    min-height: 0;
    padding: clamp(20px, 4vw, 32px) clamp(16px, 3vw, 24px);
    /* overflow-y: auto; */
    overflow-x: hidden;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

@media (max-width: 768px) {
    .chat-messages {
        padding: 16px 12px;
        gap: 12px;
    }
}

.message {
    display: flex;
    gap: 12px;
    animation: fadeInUp 0.3s var(--transition-base);
    align-items: flex-start;
    max-width: 75%;
}

.message.user {
    flex-direction: row-reverse;
    align-self: flex-end;
    margin-left: auto;
}

.message.assistant {
    align-self: flex-start;
    max-width: 85%;
}

@media (max-width: 768px) {
    .message {
        max-width: 90%;
    }
    
    .message.assistant {
        max-width: 95%;
    }
}

.message-avatar {
    font-size: clamp(20px, 3vw, 24px);
    flex-shrink: 0;
    line-height: 1;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.message-content {
    padding: clamp(10px, 2vw, 14px) clamp(14px, 2vw, 18px);
    border-radius: 18px;
    font-size: clamp(14px, 2vw, 15px);
    line-height: 1.7;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    box-shadow: var(--shadow-sm);
    position: relative;
    max-width: 100%;
}

.message.user .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 18px 18px 4px 18px;
}

.message.assistant .message-content {
    color: var(--text-primary);
    border-radius: 18px 18px 18px 4px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

.message.assistant .message-content p {
    margin: 0 0 12px 0;
}

.message.assistant .message-content p:last-child {
    margin-bottom: 0;
}

.message.assistant .message-content ul,
.message.assistant .message-content ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message.assistant .message-content li {
    margin-bottom: 6px;
}

.message.assistant .message-content h1,
.message.assistant .message-content h2,
.message.assistant .message-content h3,
.message.assistant .message-content h4 {
    margin-top: 16px;
    margin-bottom: 8px;
    font-weight: 600;
}

.message.assistant .message-content h1:first-child,
.message.assistant .message-content h2:first-child,
.message.assistant .message-content h3:first-child {
    margin-top: 0;
}

@media (max-width: 768px) {
    .message-content {
        font-size: 14px;
        padding: 10px 14px;
        line-height: 1.6;
    }
}

.message-content pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 12px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 12px 0;
    font-size: clamp(12px, 1.8vw, 13px);
    border: 1px solid var(--border-color);
    max-width: 100%;
}

[data-theme="dark"] .message-content pre {
    background: rgba(255, 255, 255, 0.05);
}

.message-content code {
    font-family: 'Courier New', monospace;
    font-size: clamp(12px, 1.8vw, 13px);
    background: rgba(102, 126, 234, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent);
}

.message-content pre code {
    background: transparent;
    padding: 0;
    color: var(--text-primary);
}

[data-theme="dark"] .message-content code {
    background: rgba(102, 126, 234, 0.2);
}

.chat-input-container {
    /* padding: clamp(16px, 3vw, 20px) clamp(20px, 4vw, 24px); */
    /* background: var(--bg-card); */
    background: none;
    /* border-top: 1px solid var(--border-color); */
    flex-shrink: 0;
    /* box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05); */
}

@media (max-width: 768px) {
    .chat-input-container {
        padding: 12px 16px 0px 16px;
    }
}

#chatForm {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    max-width: 100%;
    margin: 0;
    width: 100%;
    padding: clamp(12px, 2vw, 16px);
}

#messageInput {
    flex: 1;
    padding: clamp(12px, 2vw, 14px) ;
    border: 2px solid var(--border-color);
    border-radius: 24px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: clamp(14px, 2vw, 15px);
    font-family: 'Inter', sans-serif;
    transition: all var(--transition-base);
    resize: none;
    overflow-y: hidden;          
    min-height: 42px;
    max-height: 160px;           
    line-height: 1;
}

#messageInput:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.send-btn {
    width: clamp(44px, 8vw, 52px);
    height: clamp(44px, 8vw, 52px);
    background: var(--accent);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    flex-shrink: 0;
    box-shadow: var(--shadow);
}

.send-btn:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: scale(1.08);
    box-shadow: var(--shadow-md);
}

.send-btn:active {
    transform: scale(0.95);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.typing-indicator {
    display: flex;
    gap: 6px;
    padding: 8px 0;
    align-items: center;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
    opacity: 0.7;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@media (max-width: 768px) {
    .message {
        max-width: 85%;
    }

    .message-avatar {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    .message-content {
        font-size: 14px;
        padding: 10px 14px;
    }
    
    .back-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* ============================================ PAGINATION ============================================ */
.pagination-container {
    margin-top: clamp(32px, 5vw, 48px);
    padding: clamp(20px, 3vw, 24px) 0;
    border-top: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.pagination-info {
    font-size: clamp(13px, 2vw, 14px);
    font-weight: 600;
    color: var(--text-secondary);
}

.pagination-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: clamp(8px, 1.5vw, 10px) clamp(14px, 2.5vw, 16px);
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: clamp(13px, 2vw, 14px);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--accent);
    background: var(--accent-light);
    transform: translateY(-2px);
}

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

.pagination-numbers {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-number {
    min-width: clamp(32px, 6vw, 40px);
    height: clamp(32px, 6vw, 40px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: clamp(12px, 2vw, 13px);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.pagination-number:hover {
    border-color: var(--accent);
    background: var(--accent-light);
    transform: scale(1.1);
}

.pagination-number.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-glow);
}

.pagination-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: clamp(32px, 6vw, 40px);
    height: clamp(32px, 6vw, 40px);
    color: var(--text-muted);
    font-size: clamp(14px, 2vw, 16px);
    font-weight: 700;
    user-select: none;
    pointer-events: none;
}

/* ============================================ LOGIN PAGE ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin-left: 0;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #a78bfa 0%, #c084fc 25%, #e879f9 50%, #f472b6 75%, #a78bfa 100%);
    background-size: 200% 200%;
}

/* Gradient bars background container */
.gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

/* Individual slanted gradient bars */
.gradient-bar {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.7;
    transition: transform 0.08s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Bar 1 - Large purple/violet (top-left) */
.bar-1 {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    top: -200px;
    left: -100px;
    animation: float 12s ease-in-out infinite;
}

/* Bar 2 - Large pink/magenta (middle-left) */
.bar-2 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    top: 50%;
    left: -150px;
    transform: translateY(-50%);
    animation: float 15s ease-in-out infinite 2s;
}

/* Bar 3 - Medium purple (bottom-left) */
.bar-3 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #a78bfa 0%, #9333ea 100%);
    bottom: -100px;
    left: 50px;
    animation: float 18s ease-in-out infinite 4s;
}

/* Bar 4 - Small accent violet (hidden on mobile, appears on large screens) */
.bar-4 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, #f0abfc 0%, #e879f9 100%);
    top: 200px;
    right: -200px;
    animation: float 20s ease-in-out infinite 3s;
}

/* Floating animation for bars */
@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(20px, -20px) scale(1.02);
    }
    50% {
        transform: translate(-10px, 30px) scale(0.98);
    }
    75% {
        transform: translate(30px, 10px) scale(1.01);
    }
}

/* Gradient shift animation */
@keyframes gradientShift {
    0%, 100% {
        filter: blur(40px) hue-rotate(0deg);
    }
    50% {
        filter: blur(40px) hue-rotate(10deg);
    }
}

.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

.login-container {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 10;
    animation: fadeInUp 0.8s var(--transition-slow);
}

.login-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-radius: 28px;
    padding: clamp(32px, 5vw, 48px);
    border: 1.5px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), inset 0 1px 1px rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
    animation: cardEntrance 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    opacity: 0.5;
}

.logo {
    text-align: center;
    margin-bottom: 16px;
}

.logo h1 {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(32px, 5vw, 40px);
    font-weight: 800;
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    letter-spacing: -0.5px;
    animation: logoReveal 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s backwards;
}

.tagline {
    text-align: center;
    color: rgba(0, 0, 0, 0.72);
    margin-bottom: 32px;
    font-size: clamp(14px, 2vw, 15px);
    font-weight: 500;
    line-height: 1.5;
    animation: fadeInSlide 0.8s ease 0.3s backwards;
}

.login-form h2 {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(20px, 3vw, 24px);
    font-weight: 700;
    margin-bottom: 8px;
    color: rgba(0, 0, 0, 0.9);
    animation: fadeInSlide 0.8s ease 0.4s backwards;
}

.login-description {
    color: rgba(0, 0, 0, 0.68);
    font-size: clamp(13px, 2vw, 14px);
    margin-bottom: 28px;
    line-height: 1.6;
    animation: fadeInSlide 0.8s ease 0.5s backwards;
}

.google-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: clamp(14px, 2vw, 16px) clamp(28px, 4vw, 32px);
    background: rgba(255, 255, 255, 0.95);
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: clamp(14px, 2vw, 16px);
    font-weight: 600;
    color: rgba(0, 0, 0, 0.85);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    animation: fadeInSlide 0.8s ease 0.6s backwards;
}

.google-login-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(168, 85, 247, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.google-login-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 28px rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.2);
}

.google-login-btn:hover::before {
    width: 300px;
    height: 300px;
}

.google-login-btn:active {
    transform: translateY(-1px) scale(0.98);
}

.google-login-btn svg {
    position: relative;
    z-index: 1;
    transition: transform 0.6s ease;
}

.google-login-btn:hover svg {
    animation: iconSpin 0.6s ease;
}

.google-login-btn span {
    position: relative;
    z-index: 1;
}

.login-footer {
    margin-top: 32px;
    text-align: center;
    color: rgba(0, 0, 0, 0.6);
    font-size: clamp(12px, 2vw, 13px);
    font-weight: 500;
    animation: fadeInSlide 0.8s ease 0.7s backwards;
}

/* Card entrance animation */
@keyframes cardEntrance {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Logo reveal animation */
@keyframes logoReveal {
    0% {
        opacity: 0;
        transform: scale(0.8) rotate(-5deg);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0);
        filter: blur(0);
    }
}

/* Fade and slide animation */
@keyframes fadeInSlide {
    0% {
        opacity: 0;
        transform: translateY(12px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Icon spin animation */
@keyframes iconSpin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Error shake animation */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-6px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(6px);
    }
}

.error-message {
    animation: shake 0.5s ease, fadeInSlide 0.3s ease;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .gradient-bar,
    .login-card,
    .logo h1,
    .tagline,
    .login-form,
    .google-login-btn,
    .login-footer {
        animation: none !important;
    }
    
    .gradient-bar {
        transition: none;
    }
    
    .google-login-btn {
        transition: all 0.2s ease;
    }
    
    .google-login-btn:hover {
        transform: none;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .bar-4 {
        display: none;
    }
    
    .bar-1 {
        width: 400px;
        height: 400px;
        top: -150px;
        left: -50px;
    }
    
    .bar-2 {
        width: 350px;
        height: 350px;
        left: -100px;
    }
    
    .bar-3 {
        width: 300px;
        height: 300px;
        bottom: -50px;
        left: 0;
    }
    
    .login-card {
        padding: clamp(24px, 4vw, 36px);
        border-radius: 24px;
    }
    
    .google-login-btn:hover {
        transform: translateY(-2px);
    }
}

@media (max-width: 480px) {
    .gradient-bar {
        filter: blur(50px);
        opacity: 0.6;
    }
    
    .bar-1 {
        width: 350px;
        height: 350px;
        top: -120px;
        left: -80px;
    }
    
    .bar-2 {
        width: 300px;
        height: 300px;
        left: -120px;
    }
    
    .bar-3 {
        width: 250px;
        height: 250px;
        bottom: -30px;
    }
    
    .login-card {
        padding: 24px 20px;
        border-radius: 20px;
    }
    
    .logo h1 {
        font-size: 28px;
    }
    
    .login-form h2 {
        font-size: 18px;
    }
}

/* ============================================ GENERATE PAGE ============================================ */

.generate-container {
    max-width: 1200px;
    margin: 0 auto;
}

.generate-form-card,
.generated-preview,
.edit-mode {
    background: var(--bg-card);
    border-radius: 20px;
    padding: clamp(24px, 4vw, 32px);
    border: 2px solid var(--border-color);
    margin-bottom: 32px;
}

.generate-form-card h3,
.preview-header h3 {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(20px, 3vw, 24px);
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.form-hint {
    font-size: clamp(12px, 1.8vw, 13px);
    color: var(--text-muted);
    margin-top: 6px;
}

.generated-preview,
.edit-mode {
    display: none;
    animation: fadeInUp 0.5s var(--transition-base);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.similarity-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 2px solid var(--warning);
    border-radius: 16px;
    padding: clamp(16px, 3vw, 20px);
    margin-bottom: 24px;
    display: flex;
    gap: 16px;
}

.warning-icon {
    font-size: clamp(28px, 4vw, 32px);
    flex-shrink: 0;
}

.warning-content h4 {
    font-size: clamp(16px, 2.5vw, 18px);
    font-weight: 700;
    color: var(--warning);
    margin-bottom: 8px;
}

.warning-content p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: clamp(13px, 2vw, 14px);
}

.similar-idea-item {
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.similarity-percent {
    font-size: clamp(11px, 1.8vw, 12px);
    font-weight: 700;
    color: var(--warning);
}

.preview-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: clamp(20px, 3vw, 24px);
    border: 2px solid var(--border-color);
}

.preview-header-content {
    display: flex;
    gap: 16px;
    align-items: start;
    margin-bottom: 24px;
}

.preview-icon {
    font-size: clamp(40px, 6vw, 48px);
    flex-shrink: 0;
}

.preview-section {
    margin-bottom: 20px;
}

.preview-section h4 {
    font-size: clamp(12px, 2vw, 13px);
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-section p {
    font-size: clamp(14px, 2vw, 15px);
    color: var(--text-primary);
    line-height: 1.6;
}

/* ============================================ UTILITIES ============================================ */
.empty-state {
    text-align: center;
    padding: clamp(40px, 6vw, 60px) 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: clamp(48px, 8vw, 64px);
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: clamp(18px, 3vw, 20px);
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: clamp(13px, 2vw, 14px);
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ============================================ RESPONSIVE BREAKPOINTS ============================================ */
@media (max-width: 1024px) {
    .main-container.sidebar-visible {
        margin-left: 280px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        box-shadow: var(--shadow-xl);
        padding-top: 80px;
    }

    .main-container {
        margin-top: 70px;
    }

    .main-container.sidebar-visible {
        margin-left: 0;
    }

    .message-content {
        max-width: 85%;
    }

    /* .chat-container { height: calc(100vh - 100px); } */
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .search-filter-container {
        flex-direction: row;
        width: 100%;
        gap: 8px;
    }

    .search-box {
        flex: 1;
        min-width: 0;
    }

    .filter-btn {
        flex-shrink: 0;
        padding: clamp(10px, 2vw, 12px) clamp(12px, 2.5vw, 16px);
        font-size: 13px;
    }

    .preview-actions,
    .filter-modal-actions {
        flex-direction: column;
    }

    .preview-actions button,
    .filter-modal-actions button {
        width: 100%;
    }

    .similarity-warning {
        flex-direction: column;
    }

    .project-footer {
        flex-direction: row;
        align-items: center;
    }

    .project-actions {
        display: flex;
        gap: 8px;
    }

    .like-btn,
    .ai-btn {
        padding: 8px 12px;
        font-size: 12px;
        flex-shrink: 0;
    }
}

/* ============================================ PROJECT ICON STYLES Add this to your style.css if not already present ============================================ */
.project-icon {
    font-size: clamp(32px, 5vw, 40px);
    flex-shrink: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}


.project-summary {
    flex: 1;
}

 
   /* MOBILE CHAT OPTIMIZATION  */
@media (max-width: 480px) {
    .chat-header {
        padding: 10px 12px;
        min-height: 56px;
    }
    
    .project-info h2 {
        font-size: 13px;
        max-width: calc(100vw - 180px);
    }
    
    .project-field {
        font-size: 11px;
    }
    
    .back-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .message {
        max-width: 90%;
    }
    
    .message-content {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    #messageInput {
        font-size: 14px;
        padding: 10px 14px 10px 14px;
        min-height: 42px;
    }
    
    .send-btn {
        width: 42px;
        height: 42px;
    }
}


/* ============================================ 
   SUBMIT IDEA SECTION 
============================================ */
.submit-container {
    max-width: 900px;
    margin: 0 auto;
}

.submit-form-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: clamp(28px, 4vw, 40px);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.submit-btn {
    width: 100%;
    padding: clamp(14px, 2vw, 16px) clamp(24px, 3vw, 32px);
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: clamp(15px, 2vw, 16px);
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-base);
    margin-top: 24px;
    box-shadow: var(--shadow);
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.submit-btn .loading-spinner {
    display: inline-block;
    margin-left: 8px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}