/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #111827 0%, #1e3a8a 50%, #111827 100%);
    color: #ffffff;
    overflow: hidden;
}

/* Layout */
.flex {
    display: flex;
}

.h-screen {
    height: 100vh;
}

.hidden {
    display: none !important;
}

/* Sidebar */
.sidebar {
    width: 16rem;
    background-color: #030712;
    border-right: 1px solid #1f2937;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #1f2937;
}

.project-name-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.text-blue {
    color: #3b82f6;
}

.project-name-input {
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 500;
    flex: 1;
}

.download-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-download-all,
.btn-download-md {
    flex: 1;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    transition: all 0.2s;
}

.btn-download-all {
    background-color: #2563eb;
    color: #ffffff;
}

.btn-download-all:hover {
    background-color: #1d4ed8;
}

.btn-download-md {
    background-color: #059669;
    color: #ffffff;
}

.btn-download-md:hover {
    background-color: #047857;
}

.file-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.file-count {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    padding: 0 0.5rem;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.no-files-message {
    text-align: center;
    color: #4b5563;
    font-size: 0.75rem;
    margin-top: 2rem;
    padding: 0 0.5rem;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

.file-item:hover {
    background-color: #1f2937;
}

.file-item-active {
    background-color: #1f2937;
    border-left: 2px solid #3b82f6;
}

.file-icon {
    color: #3b82f6;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.file-name-text {
    font-size: 0.75rem;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-delete-btn {
    opacity: 0;
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

.file-item:hover .file-delete-btn {
    opacity: 1;
}

.file-delete-btn:hover {
    background-color: #dc2626;
}

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid #1f2937;
}

.btn-settings {
    width: 100%;
    background-color: #1f2937;
    color: #ffffff;
    border: none;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background-color 0.2s;
}

.btn-settings:hover {
    background-color: #374151;
}

/* Main Area */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: linear-gradient(90deg, #2563eb 0%, #7c3aed 100%);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-icon {
    font-size: 1.75rem;
}

.header-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.header-subtitle {
    color: #bfdbfe;
    font-size: 0.75rem;
}

.btn-clear {
    background-color: #ef4444;
    color: #ffffff;
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s;
}

.btn-clear:hover {
    background-color: #dc2626;
}

/* Settings Panel */
.settings-panel {
    background-color: #1f2937;
    border-bottom: 1px solid #374151;
    padding: 1rem;
}

.settings-content {
    max-width: 42rem;
}

.settings-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.settings-input {
    width: 100%;
    background-color: #374151;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #ffffff;
    outline: none;
    transition: all 0.2s;
}

.settings-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.settings-help {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.5rem;
}

/* Content Area */
.content-area {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Chat Container */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* Scrollbar Styling */
.chat-area::-webkit-scrollbar,
.file-list-container::-webkit-scrollbar,
.file-viewer-content::-webkit-scrollbar {
    width: 8px;
}

.chat-area::-webkit-scrollbar-track,
.file-list-container::-webkit-scrollbar-track,
.file-viewer-content::-webkit-scrollbar-track {
    background: #1f2937;
}

.chat-area::-webkit-scrollbar-thumb,
.file-list-container::-webkit-scrollbar-thumb,
.file-viewer-content::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 4px;
}

/* Welcome Screen */
.welcome-screen {
    text-align: center;
    margin-top: 5rem;
}

.welcome-icon {
    font-size: 4rem;
    opacity: 0.5;
    margin-bottom: 1.5rem;
}

.welcome-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.welcome-examples {
    max-width: 42rem;
    margin: 0 auto;
}

.examples-box {
    background-color: #1f2937;
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: left;
}

.examples-title {
    font-size: 0.875rem;
    color: #d1d5db;
    margin-bottom: 0.5rem;
}

.examples-list {
    font-size: 0.75rem;
    color: #9ca3af;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Messages */
.message {
    margin-bottom: 1rem;
}

.message-user {
    text-align: right;
}

.message-assistant {
    text-align: left;
}

.message-bubble {
    display: inline-block;
    max-width: 56rem;
    text-align: left;
    border-radius: 1rem;
    padding: 1rem;
}

.bubble-user {
    background-color: #2563eb;
}

.bubble-assistant {
    background-color: #1f2937;
}

.message-role {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-bottom: 0.5rem;
}

.message-text {
    white-space: pre-wrap;
    line-height: 1.6;
}

.file-header {
    margin: 0.5rem 0;
    font-weight: 700;
    color: #34d399;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.code-block {
    margin: 0.75rem 0;
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: #374151;
    color: #ffffff;
    border: none;
    border-radius: 0.25rem;
    padding: 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    opacity: 0;
    transition: all 0.2s;
}

.code-block:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    background-color: #4b5563;
}

.code-pre {
    background-color: #030712;
    border: 1px solid #374151;
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
    font-size: 0.875rem;
}

.code-content {
    color: #34d399;
}

/* Loading Animation */
.loading-dots {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.dot {
    width: 0.5rem;
    height: 0.5rem;
    background-color: #3b82f6;
    border-radius: 50%;
    animation: bounce 1s infinite;
}

.dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-0.625rem);
    }
}

.loading-text {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-left: 0.5rem;
}

/* Input Area */
.input-area {
    border-top: 1px solid #374151;
    padding: 1rem;
    background-color: #111827;
}

.input-container {
    display: flex;
    gap: 0.5rem;
}

.user-input {
    flex: 1;
    background-color: #1f2937;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: #ffffff;
    outline: none;
    transition: all 0.2s;
}

.user-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-send {
    background-color: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-send:hover:not(:disabled) {
    background-color: #1d4ed8;
}

.btn-send:disabled {
    background-color: #374151;
    cursor: not-allowed;
}

/* File Viewer */
.file-viewer {
    width: 24rem;
    background-color: #030712;
    border-left: 1px solid #1f2937;
    display: flex;
    flex-direction: column;
}

.file-viewer-header {
    padding: 0.75rem;
    border-bottom: 1px solid #1f2937;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.file-viewer-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-name {
    font-size: 0.875rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-viewer-actions {
    display: flex;
    gap: 0.25rem;
}

.icon-btn {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
}

.icon-btn:hover {
    background-color: #1f2937;
}

.file-viewer-content {
    flex: 1;
    overflow: auto;
    padding: 1rem;
}

.file-code {
    font-size: 0.75rem;
    color: #34d399;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 12rem;
    }
    
    .file-viewer {
        width: 20rem;
    }
    
    .header-title {
        font-size: 1rem;
    }
}