* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}
pre {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 10px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}
.dark-mode pre {
    background: rgba(255, 255, 255, 0.1);
}
code {
    font-family: 'Courier New', monospace;
    font-size: 14px;
}
pre code {
    background: none;
    padding: 0;
}

body {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, #f0f2f5 0%, #e4e7eb 100%);
    color: #333;
    transition: background 0.3s ease, color 0.3s ease;
}

body.dark-mode {
    background: linear-gradient(135deg, #1a1a1a 0%, #2c2c2c 100%);
    color: #e0e0e0;
}

.container {
    display: flex;
    width: 100%;
    height: 100%;
}

.sidebar {
    width: 300px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    padding: 20px;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.dark-mode .sidebar {
    background: rgba(30, 30, 30, 0.95);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header {
    margin-bottom: 20px;
}

.sidebar-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1a73e8;
    text-align: center;
}

.dark-mode .sidebar-header h2 {
    color: #4a90e2;
}

.new-chat-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.3s ease, transform 0.2s ease;
}

.new-chat-btn img {
    width: 20px;
    height: 20px;
}

.new-chat-btn:hover {
    background: #1557b0;
    transform: translateY(-2px);
}

.chat-history {
    flex-grow: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #888 #f0f2f5;
}

.dark-mode .chat-history {
    scrollbar-color: #888 #2c2c2c;
}

.chat-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.dark-mode .chat-history-item {
    background: rgba(50, 50, 50, 0.8);
}

.chat-history-item:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateX(5px);
}

.dark-mode .chat-history-item:hover {
    background: rgba(70, 70, 70, 0.9);
}

.chat-history-item img {
    width: 18px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.chat-history-item img:hover {
    opacity: 1;
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.mode-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 99;
    background: inherit;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.hamburger-lines, .hamburger-lines::before, .hamburger-lines::after {
    content: '';
    display: block;
    width: 24px;
    height: 3px;
    background: #333;
    border-radius: 2px;
    position: relative;
    transition: all 0.3s ease;
}

.dark-mode .hamburger-lines, .dark-mode .hamburger-lines::before, .dark-mode .hamburger-lines::after {
    background: #e0e0e0;
}

.hamburger-lines::before, .hamburger-lines::after {
    position: absolute;
    left: 0;
}

.hamburger-lines::before {
    top: -8px;
}

.hamburger-lines::after {
    top: 8px;
}

.hamburger.active .hamburger-lines {
    background: transparent;
}

.hamburger.active .hamburger-lines::before {
    transform: rotate(45deg);
    top: 0;
}

.hamburger.active .hamburger-lines::after {
    transform: rotate(-45deg);
    top: 0;
}

.mode-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: #1a73e8;
    color: white;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.3s ease, transform 0.2s ease;
}

.mode-btn:hover {
    background: #1557b0;
    transform: translateY(-2px);
}

.dark-mode .mode-btn {
    background: #4a90e2;
}

.dark-mode .mode-btn:hover {
    background: #357abd;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.theme-toggle img {
    width: 24px;
    transition: transform 0.3s ease;
}

.theme-toggle:hover img {
    transform: rotate(15deg);
}

.chat-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 11px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.dark-mode .chat-container {
    background: rgba(30, 30, 30, 0.9);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.chat-box {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #888 #f0f2f5;
}

.dark-mode .chat-box {
    scrollbar-color: #888 #2c2c2c;
}

.message {
    margin-bottom: 20px;
    padding: 1px 1px;
    border-radius: 12px;
    max-width: 80%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 16px;
    line-height: 1.5;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dark-mode .message {
    background: rgba(50, 50, 50, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.message.user {
    margin-left: auto;
    background: rgba(26, 115, 232, 0.3);
    color: #fff;
    border: 1px solid rgba(26, 115, 232, 0.5);
    border-bottom-right-radius: 2px;
}

.message.ai {
    border-bottom-left-radius: 2px;
}

.message:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dark-mode .message:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.input-container {
    display: flex;
    padding: 15px;
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    position: sticky;
    bottom: 0;
    z-index: 100;
}

.dark-mode .input-container {
    background: rgba(30, 30, 30, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.input-container textarea {
    flex-grow: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    resize: none;
    background: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    line-height: 1.5;
    transition: background 0.3s ease;
}

.dark-mode .input-container textarea {
    background: rgba(50, 50, 50, 0.8);
    color: #e0e0e0;
}

.input-container textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 1);
}

.dark-mode .input-container textarea:focus {
    background: rgba(70, 70, 70, 1);
}

.input-container button {
    padding: 12px 24px;
    border: none;
    background: #1a73e8;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    margin-left: 10px;
    transition: background 0.3s ease, transform 0.2s ease;
}

.input-container button:hover {
    background: #1557b0;
    transform: translateY(-2px);
}

/* Mobil moslashuvchanlik */
@media (max-width: 768px) {
    .sidebar {
        width: 80%;
        max-width: 300px;
        position: fixed;
        top: 0;
        left: 0;
        transform: translateX(-100%);
        height: 100%;
        z-index: 1000;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    }

    .dark-mode .sidebar {
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.4);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .hamburger {
        display: block;
        position: absolute;
        left: 10px;
        top: 10px;
    }

    .main-content {
        width: 100%;
        padding: 10px;
    }

    .mode-toggle {
        justify-content: center;
        padding: 10px 0;
        position: sticky;
        top: 0;
        z-index: 99;
        background: inherit;
    }

    .chat-container {
        height: calc(100vh - 80px); /* Input va mode-toggle uchun joy */
    }

    .chat-box {
        padding-bottom: 80px; /* Input menyusi uchun joy */
    }

    .input-container {
        padding: 10px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
        background: inherit;
    }

    .input-container textarea {
        font-size: 14px;
        padding: 10px;
    }

    .input-container button {
        padding: 10px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .sidebar-header h2 {
        font-size: 20px;
    }

    .new-chat-btn {
        font-size: 14px;
        padding: 10px;
    }

    .chat-history-item {
        font-size: 14px;
        padding: 10px;
    }

    .mode-btn {
        font-size: 14px;
        padding: 8px 16px;
    }

    .message {
        font-size: 14px;
        padding: 10px 14px;
    }

    .chat-container {
        height: calc(100vh - 70px);
    }
}

@media (min-width: 769px) {
    .hamburger {
        display: none;
    }

    .sidebar {
        transform: translateX(0); /* Katta ekranlarda doim ochiq */
    }
}

/* Scrollbar dizayni */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f0f2f5;
}

.dark-mode ::-webkit-scrollbar-track {
    background: #2c2c2c;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #666;
}