/* Modern Study Guide Generator - Sleek Design System */

/* Import modern font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* CSS Variables for consistent theming */
:root {
    /* Colors - Elegant purple/blue gradient theme */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-color: #4f46e5;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;

    /* Neutral colors */
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: rgba(148, 163, 184, 0.2);

    /* Shadows and effects */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Transitions */
    --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, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Animated background gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0.05;
    z-index: -1;
}

/* Container - Optimized for above-the-fold content */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    animation: fadeIn 0.5s ease-out;
}

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

/* Header - Compact for better UX */
.header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
    animation: slideDown 0.6s ease-out;
}

.header .subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 400;
}

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

/* Card Component - Reduced padding */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-header .icon {
    width: 30px;
    height: 30px;
    margin-right: 1rem;
    background: var(--primary-gradient);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* Form Styles - Tighter spacing */
.form-group {
    margin-bottom: 1rem;
}

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

/* File Upload Area - Fixed alignment */
.file-upload-area {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    cursor: pointer;
}

.file-upload-area .upload-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.file-upload-area .upload-text {
    text-align: left;
}

.file-upload-area:hover {
    border-color: var(--accent-color);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.file-upload-area.dragover {
    border-color: var(--accent-color);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    transform: scale(1.02);
}

.upload-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.file-upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-info {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(79, 70, 229, 0.05) 100%);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.file-info span:first-child {
    font-weight: 500;
    color: var(--text-primary);
}

/* Select and Input Styles */
select, input[type="text"], input[type="number"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: white;
}

select:focus, input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Radio Group */
.radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.radio-option {
    position: relative;
    flex: 1;
    min-width: 120px;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.radio-option label {
    display: block;
    padding: 0.75rem 1rem;
    text-align: center;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.radio-option input[type="radio"]:checked + label {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

.radio-option label:hover {
    border-color: var(--accent-color);
}

/* Buttons */
.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

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

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-color);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

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

/* Button Group */
.button-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideIn 0.3s ease-out;
}

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

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    border-left: 4px solid var(--success-color);
    color: #065f46;
}

.alert-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
    border-left: 4px solid var(--error-color);
    color: #991b1b;
}

.alert-info {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(79, 70, 229, 0.05) 100%);
    border-left: 4px solid var(--accent-color);
    color: #312e81;
}

/* Output Display */
.output-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
    border: 1px solid var(--border-color);
    max-height: 600px;
    overflow-y: auto;
}

.output-container::-webkit-scrollbar {
    width: 8px;
}

.output-container::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 10px;
}

.output-container::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 10px;
}

.output-container h1, .output-container h2, .output-container h3 {
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.output-container h1 {
    font-size: 1.8rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.output-container h2 {
    font-size: 1.4rem;
    color: var(--accent-color);
}

.output-container p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.output-container ul, .output-container ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.output-container li {
    margin-bottom: 0.5rem;
}

/* Loading Spinner */
.loading {
    display: none;
    text-align: center;
    padding: 2rem;
}

.loading.active {
    display: block !important;
    animation: fadeIn 0.3s ease-out;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Copy Button */
.copy-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: var(--transition);
}

.copy-btn:hover {
    transform: scale(1.05);
}

.copy-btn.copied {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

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

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

    .card {
        padding: 1.5rem;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .btn, .button-group {
        display: none;
    }
}

/* Animations for elements */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

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

/* Progress Steps - Compact */
.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.3rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition);
}

.step.active .step-number {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

.step.completed .step-number {
    background: var(--success-color);
    color: white;
    border-color: transparent;
}

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

.step.active .step-label {
    color: var(--text-primary);
    font-weight: 500;
}
