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

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-color);
    min-height: 100vh;
    position: relative;
}

/* Background Shapes */
.background-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    opacity: 0.05;
    animation: float 20s ease-in-out infinite;
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: -150px;
    right: -150px;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    bottom: -100px;
    left: -100px;
    animation-delay: -7s;
}

.shape-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    left: 10%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-30px) rotate(120deg); }
    66% { transform: translateY(30px) rotate(240deg); }
}

/* Header */
.header {
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    text-align: center;
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

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

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 3rem;
}

.hero-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.mode-indicator {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 1rem;
}

.ai-mode {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.lite-mode {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

/* Upload Section */
.upload-section {
    background: var(--surface-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* File Upload */
.file-upload-wrapper {
    position: relative;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 2rem;
}

.file-upload-label:hover {
    border-color: var(--primary-color);
    background: #f1f5f9;
}

.upload-icon {
    width: 3rem;
    height: 3rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

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

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

#file {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-info {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #ecfdf5;
    border: 1px solid #10b981;
    border-radius: var(--radius-md);
    color: #065f46;
    font-size: 0.875rem;
}

/* Settings Section */
.settings-section {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

.settings-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.input-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
}

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

input[type="number"] {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--surface-color);
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Submit Button */
.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 1rem;
}

.submit-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

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

.btn-icon {
    width: 1.25rem;
    height: 1.25rem;
}

/* Loader */
.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 3rem;
    background: var(--surface-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid #e2e8f0;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-text {
    font-size: 1.125rem;
    color: var(--text-secondary);
    text-align: center;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Result Section */
.result-section {
    background: var(--surface-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.result-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--success-color);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-lg);
    font-weight: 500;
    transition: all 0.2s ease;
}

.download-btn:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.download-icon {
    width: 1rem;
    height: 1rem;
}

.summary-content {
    background: #f8fafc;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.summary-text {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-primary);
    white-space: pre-wrap;
    font-family: 'Inter', system-ui, sans-serif;
}

/* Enhanced formatting for summary content */
.summary-text h1, .summary-text h2, .summary-text h3 {
    color: var(--primary-color);
    font-weight: 600;
    margin: 1.5rem 0 0.75rem 0;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.summary-text h1 {
    font-size: 1.5rem;
    text-align: center;
    color: var(--primary-color);
}

.summary-text h2 {
    font-size: 1.25rem;
    color: var(--success-color);
}

.summary-text h3 {
    font-size: 1.125rem;
    color: var(--secondary-color);
}

.summary-text .section-header {
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    margin: 1rem 0 0.5rem 0;
    display: block;
}

.summary-text .numbered-point {
    background: #f1f5f9;
    border-left: 4px solid var(--primary-color);
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.summary-text .key-terms {
    background: #ecfdf5;
    border: 1px solid var(--success-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: #065f46;
}

.summary-text .disclaimer {
    background: #fef3cd;
    border: 1px solid var(--warning-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    color: #92400e;
}

.summary-text .separator {
    border: none;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--border-color), transparent);
    margin: 1.5rem 0;
}

/* Feedback Section */
.feedback-section {
    background: var(--surface-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.feedback-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

.textarea-wrapper {
    display: flex;
    flex-direction: column;
}

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

textarea {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    transition: all 0.2s ease;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.feedback-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feedback-btn:hover {
    background: var(--primary-hover);
}

.feedback-status {
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    padding: 0.5rem;
    border-radius: var(--radius-md);
}

.feedback-status.success {
    color: var(--success-color);
    background: #ecfdf5;
}

.feedback-status.error {
    color: var(--error-color);
    background: #fef2f2;
}

/* Footer */
.footer {
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .upload-section,
    .result-section,
    .feedback-section {
        padding: 1.5rem;
    }
    
    .file-upload-label {
        min-height: 150px;
        padding: 1.5rem;
    }
    
    .upload-icon {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .input-group {
        grid-template-columns: 1fr;
    }
    
    .result-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .download-btn {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .upload-section,
    .result-section,
    .feedback-section {
        padding: 1rem;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .logo {
        font-size: 1.5rem;
    }
}
