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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    min-height: 100vh;
    color: #e0e0e0;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 2.2rem;
    color: #fff;
    margin-bottom: 8px;
    font-weight: 700;
}

.header p {
    color: #a0a0c0;
    font-size: 1rem;
}

/* Card */
.card {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
}

/* Form */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #c0c0e0;
    font-size: 0.95rem;
}

.form-group label span.required {
    color: #ff6b6b;
}

/* File Upload Zone */
.upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 28px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.03);
}

.upload-zone:hover {
    border-color: #7c5cfc;
    background: rgba(124, 92, 252, 0.08);
}

.upload-zone.active {
    border-color: #7c5cfc;
    background: rgba(124, 92, 252, 0.12);
}

.upload-zone.has-file {
    border-color: #4ecdc4;
    background: rgba(78, 205, 196, 0.08);
}

.upload-zone input[type="file"] {
    display: none;
}

.upload-zone .icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.upload-zone .text {
    color: #a0a0c0;
    font-size: 0.9rem;
}

.upload-zone .file-name {
    color: #4ecdc4;
    font-weight: 600;
    margin-top: 8px;
    font-size: 0.9rem;
}

/* Textarea */
textarea {
    width: 100%;
    min-height: 120px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 14px;
    color: #e0e0e0;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: #7c5cfc;
}

textarea::placeholder {
    color: #606080;
}

/* Select */
select {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #e0e0e0;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0a0c0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

select:focus {
    outline: none;
    border-color: #7c5cfc;
}

select option {
    background: #1a1a2e;
    color: #e0e0e0;
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #7c5cfc, #5a3fd4);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.btn-submit:hover {
    background: linear-gradient(135deg, #8b6cff, #6a4fe4);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(124, 92, 252, 0.3);
}

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loading-overlay.show {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(124, 92, 252, 0.2);
    border-top: 4px solid #7c5cfc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.loading-text {
    color: #c0c0e0;
    font-size: 1rem;
    text-align: center;
}

.loading-subtext {
    color: #808090;
    font-size: 0.85rem;
    margin-top: 6px;
}

/* Results Section */
.results-section {
    display: none;
}

.results-section.show {
    display: block;
}

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

.results-header h2 {
    font-size: 1.4rem;
    color: #fff;
}

.btn-new {
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.1);
    color: #c0c0e0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-new:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.llm-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(124, 92, 252, 0.2);
    color: #b0a0ff;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 16px;
}

/* Markdown Content */
.markdown-content {
    line-height: 1.7;
    color: #d0d0e0;
}

.markdown-content h1 {
    font-size: 1.6rem;
    color: #fff;
    margin: 24px 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.markdown-content h2 {
    font-size: 1.25rem;
    color: #e0e0ff;
    margin: 20px 0 10px 0;
}

.markdown-content h3 {
    font-size: 1.1rem;
    color: #c0c0e0;
    margin: 16px 0 8px 0;
}

.markdown-content p {
    margin-bottom: 12px;
}

.markdown-content ul, .markdown-content ol {
    margin: 8px 0 12px 24px;
}

.markdown-content li {
    margin-bottom: 4px;
}

.markdown-content strong {
    color: #fff;
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.9rem;
}

.markdown-content table th {
    background: rgba(124, 92, 252, 0.15);
    color: #c0b0ff;
    padding: 10px 12px;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.markdown-content table td {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.markdown-content table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
}

.markdown-content hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 20px 0;
}

.markdown-content code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Error */
.error-message {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 10px;
    padding: 16px;
    color: #ff6b6b;
    margin-bottom: 16px;
    display: none;
}

.error-message.show {
    display: block;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 16px 12px;
    }

    .card {
        padding: 20px 16px;
    }

    .header h1 {
        font-size: 1.6rem;
    }

    .upload-zone {
        padding: 20px;
    }
}
