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

:root {
    --primary-color: #6366F1;
    --primary-hover: #5558E3;
    --bg-primary: #FAFAFA;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F5F5F7;
    --text-primary: #1A1A1A;
    --text-secondary: #6B7280;
    --text-tertiary: #9CA3AF;
    --border-color: #E5E7EB;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --sidebar-width: 280px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.logo svg {
    flex-shrink: 0;
}

.logo h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.upgrade-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    width: fit-content;
}

.upgrade-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.flash-text {
    font-size: 12px;
    color: var(--text-secondary);
}

.new-chat-btn {
    margin: 16px;
    padding: 12px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: calc(100% - 32px);
}

.new-chat-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.new-chat-btn svg {
    flex-shrink: 0;
}

.sidebar-nav {
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 4px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all 0.15s ease;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item svg {
    flex-shrink: 0;
}

.recent-section {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.recent-section h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.recent-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.recent-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.recent-item svg {
    flex-shrink: 0;
    opacity: 0.6;
}

.recent-item span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.more-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.15s ease;
}

.recent-item:hover .more-btn {
    opacity: 1;
}

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

.collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px;
    margin-top: 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.collapse-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

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

.footer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 4px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all 0.15s ease;
    position: relative;
}

.footer-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #10B981;
    border-radius: 50%;
    position: absolute;
    right: 12px;
}

/* Main Content Styles */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: var(--bg-primary);
}

.main-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.icon-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    margin-left: 4px;
}

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

.welcome-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px 40px;
    text-align: center;
}

.welcome-icon {
    margin-bottom: 24px;
    animation: fadeInUp 0.6s ease;
}

.welcome-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    animation: fadeInUp 0.6s ease 0.1s both;
}

.welcome-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    animation: fadeInUp 0.6s ease 0.2s both;
}

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

.chat-input-container {
    padding: 0 24px 32px;
    /* max-width: 900px; */
    width: 100%;
    margin: 0 auto;
}

.chat-input-wrapper {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.chat-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.chat-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 15px;
    color: var(--text-primary);
    background: transparent;
    padding-bottom: 12px;
    font-family: inherit;
}

.chat-input::placeholder {
    color: var(--text-tertiary);
}

.input-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.input-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

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

.brainstorm-btn svg path {
    fill: #F59E0B;
    stroke: none;
}

.input-icons {
    display: flex;
    align-items: center;
    /* justify-content: flex-end; */
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.icon-btn-small {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.icon-btn-small:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

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

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

.action-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    padding: 0 24px 40px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.action-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.card-icon.image {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.card-icon.video {
    background: rgba(168, 85, 247, 0.1);
    color: #A855F7;
}

.card-icon.audio {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.card-icon.editor {
    background: rgba(251, 191, 36, 0.1);
    color: #FBBF24;
}

.card-icon.education {
    background: rgba(34, 197, 94, 0.1);
    color: #22C55E;
}

.card-icon.advice {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.card-icon.code {
    background: rgba(20, 184, 166, 0.1);
    color: #14B8A6;
}

.card-icon.write {
    background: rgba(99, 102, 241, 0.1);
    color: #6366F1;
}

.card-icon.summarize {
    background: rgba(249, 115, 22, 0.1);
    color: #F97316;
}

.card-icon.problem {
    background: rgba(168, 85, 247, 0.1);
    color: #A855F7;
}

.main-footer {
    padding: 24px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.main-footer p {
    font-size: 13px;
    color: var(--text-secondary);
}

.main-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.main-footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .action-cards {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
    }

    .sidebar.open {
        left: 0;
    }

    .action-cards {
        grid-template-columns: 1fr;
    }

    .welcome-title {
        font-size: 28px;
    }

    .welcome-subtitle {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .main-header {
        padding: 12px 16px;
    }

    .chat-input-container {
        padding: 0 16px 24px;
    }

    .action-cards {
        padding: 0 16px 32px;
    }

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

/* Dark mode class */
body.dark-mode {
    --bg-primary: #0F0F0F;
    --bg-secondary: #1A1A1A;
    --bg-tertiary: #262626;
    --text-primary: #FFFFFF;
    --text-secondary: #A1A1AA;
    --text-tertiary: #71717A;
    --border-color: #2A2A2A;
}
