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

:root {
    /* Startup Blue-White Theme */
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --sidebar-bg: #1e293b;
    --primary-blue: #3b82f6;
    --primary-blue-light: #60a5fa;
    --primary-blue-dark: #2563eb;
    --accent-blue: #0ea5e9;
    --main-bg: #f8fafc;
    --text-white: #ffffff;
    --text-gray: #94a3b8;
    --text-dark: #1e293b;
    --card-bg: #1e293b;
    --card-border: #334155;
    --input-bg: #334155;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-darker);
    color: var(--text-white);
    min-height: 100vh;
}

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

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
}

.sidebar-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

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

.sidebar-nav {
    padding: 20px 16px;
}

.nav-item,
.nav-item:link,
.nav-item:visited {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: none;
    font-size: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 4px;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--text-white) !important;
}

.nav-item .icon {
    font-size: 18px;
    font-weight: 400;
}

.nav-item svg {
    stroke: rgba(255, 255, 255, 0.9);
}

.recents-section {
    padding: 16px 20px;
    flex: 1;
}

.section-title {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 14px;
}

.recents-list {
    list-style: none;
}

.recents-list li {
    margin-bottom: 2px;
}

.recents-list a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 13px;
    display: block;
    padding: 10px 14px;
    border-radius: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: all 0.2s;
}

.recents-list a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--text-white);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    background-color: rgba(0, 0, 0, 0.1);
}

.avatar {
    width: 42px;
    height: 42px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar svg {
    stroke: var(--text-white);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-white);
}

.user-plan {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

/* Main Content */
.main-content {
    flex: 1;
    background-color: var(--bg-darker);
    display: flex;
    flex-direction: column;
}

.main-header {
    display: flex;
    justify-content: flex-end;
    padding: 20px 28px;
}

.settings-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-gray);
    font-size: 14px;
    cursor: pointer;
    padding: 10px 18px;
    border-radius: 10px;
    transition: all 0.2s;
    font-weight: 500;
}

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

.settings-btn svg {
    stroke: currentColor;
}

/* Menu Toggle Button */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.menu-toggle:hover {
    background-color: var(--card-bg);
    color: var(--text-white);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* Chat Container */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.welcome-title {
    font-size: 52px;
    font-weight: 300;
    background: linear-gradient(135deg, var(--text-gray), var(--text-white));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 48px;
    text-align: center;
}

.chat-input-container {
    display: flex;
    align-items: center;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 50px;
    padding: 6px;
    width: 100%;
    max-width: 550px;
    margin-bottom: 24px;
    transition: all 0.2s;
}

.chat-input-container:focus-within {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.chat-input {
    flex: 1;
    background: none;
    border: none;
    padding: 16px 22px;
    color: var(--text-white);
    font-size: 15px;
    outline: none;
}

.chat-input:focus {
    outline: none;
}

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

.send-btn {
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.send-btn svg {
    stroke: var(--text-white);
}

/* Model Selectors */
.model-selectors {
    display: flex;
    gap: 14px;
}

.model-dropdown select,
.version-dropdown select {
    background-color: var(--card-bg);
    color: var(--text-white);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    font-weight: 500;
    transition: all 0.2s;
}

.model-dropdown select:hover,
.version-dropdown select:hover {
    border-color: var(--primary-blue);
}

.model-dropdown select:focus,
.version-dropdown select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Messages Container */
.messages-container {
    flex: 1;
    display: none;
    flex-direction: column;
    padding: 28px;
    overflow-y: auto;
    gap: 18px;
}

.message {
    max-width: 70%;
    padding: 16px 20px;
    border-radius: 20px;
    font-size: 14px;
    line-height: 1.6;
}

.user-message {
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
    color: var(--text-white);
    align-self: flex-end;
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.bot-message {
    background-color: var(--card-bg);
    color: var(--text-white);
    align-self: flex-start;
    border-bottom-left-radius: 6px;
    border: 1px solid var(--card-border);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 4px;
}

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

/* Responsive - Tablet */
@media (max-width: 900px) {
    .sidebar {
        width: 220px;
    }

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

    .chat-input-container {
        max-width: 90%;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: fixed;
        top: 0;
        left: -100%;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
    }

    .sidebar.open {
        left: 0;
    }

    .main-content {
        width: 100%;
    }

    .main-header {
        justify-content: space-between;
        padding: 16px 20px;
    }

    .menu-toggle {
        display: flex;
    }

    .sidebar-close {
        display: block;
    }

    .chat-container {
        padding: 20px;
    }

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

    .chat-input-container {
        max-width: 100%;
        border-radius: 16px;
        padding: 4px;
    }

    .chat-input {
        padding: 14px 16px;
        font-size: 14px;
    }

    .send-btn {
        width: 42px;
        height: 42px;
    }

    .model-selectors {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }

    .model-dropdown select,
    .version-dropdown select {
        width: 100%;
    }

    .messages-container {
        padding: 16px;
    }

    .message {
        max-width: 85%;
        padding: 12px 16px;
        font-size: 13px;
    }

    .recents-section {
        display: none;
    }
}

/* Responsive - Small Mobile */
@media (max-width: 480px) {
    .welcome-title {
        font-size: 24px;
    }

    .chat-input {
        padding: 12px 14px;
    }

    .send-btn {
        width: 38px;
        height: 38px;
    }

    .settings-btn span {
        display: none;
    }

    .settings-btn {
        padding: 10px;
    }
}