/* ============================================
   Document Intelligence Agent - Premium Styles
   ============================================ */

/* ===== CSS Variables ===== */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    
    --bg-dark: #0a0e27;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.2);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* ===== Background Effects ===== */
.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 20%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(245, 87, 108, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
}

/* ===== Container ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
}

/* ===== Header ===== */
.header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.6s ease-out;
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    animation: float 3s ease-in-out infinite;
}

.logo h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.875rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    animation: pulse 2s ease-in-out infinite;
}

.status-badge.error .status-dot {
    background: #f87171;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-top: 0.5rem;
}

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    animation: fadeInUp 0.6s ease-out;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-lg);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary-gradient);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* ===== Upload Section ===== */
.upload-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.upload-grid.comparing {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.upload-area {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.02);
}

.upload-area:hover {
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(255, 255, 255, 0.05);
}

.upload-area.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.02);
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

.upload-label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.upload-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.file-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: var(--radius-sm);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-icon {
    font-size: 2rem;
}

.file-name {
    font-weight: 500;
    color: var(--text-primary);
}

.file-size {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.remove-btn {
    background: rgba(248, 113, 113, 0.2);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: #f87171;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}

.remove-btn:hover {
    background: rgba(248, 113, 113, 0.3);
    transform: rotate(90deg);
}

/* ===== Configuration Section ===== */
.config-grid {
    display: grid;
    gap: 2rem;
}

.form-group {
    animation: fadeIn 0.4s ease-out;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.task-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.task-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
    font-weight: 500;
}

.task-btn:hover {
    border-color: rgba(102, 126, 234, 0.5);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.task-btn.active {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.15);
    color: var(--text-primary);
}

.task-icon {
    font-size: 1.5rem;
}

.language-selector {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.lang-btn {
    flex: 1;
    min-width: 120px;
    padding: 0.875rem 1.5rem;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.lang-btn:hover {
    border-color: rgba(102, 126, 234, 0.5);
    background: var(--bg-card-hover);
}

.lang-btn.active {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.15);
    color: var(--text-primary);
}

.query-input {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9375rem;
    resize: vertical;
    transition: var(--transition);
}

.query-input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.08);
}

.query-input::placeholder {
    color: var(--text-muted);
}

/* ===== Process Button ===== */
.process-btn {
    width: 100%;
    margin-top: 2rem;
    padding: 1.25rem 2rem;
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.process-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.process-btn:hover::before {
    left: 100%;
}

.process-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.process-btn:active {
    transform: translateY(0);
}

.process-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ===== Results Section ===== */
.results-content {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.results-content h3 {
    color: #667eea;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.results-content h3:first-child {
    margin-top: 0;
}

.results-content p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.results-content strong {
    color: var(--text-primary);
}

.results-content .missing-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(251, 191, 36, 0.1);
    border-left: 3px solid #fbbf24;
    border-radius: var(--radius-sm);
    color: #fbbf24;
}

.results-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-btn {
    flex: 1;
    min-width: 150px;
    padding: 0.875rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.action-btn:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.action-btn.secondary {
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.3);
}

.action-btn.secondary:hover {
    background: rgba(248, 113, 113, 0.2);
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

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

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .header-content {
        gap: 1rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .task-selector {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .language-selector {
        flex-direction: column;
    }
    
    .lang-btn {
        width: 100%;
    }
}
