/* Professional Case Study Generator - Advanced CSS */
:root {
    /* Light Theme */
    --primary: #4361ee;
    --primary-light: #4895ef;
    --primary-dark: #3a0ca3;
    --secondary: #f72585;
    --accent: #4cc9f0;
    --success: #4ade80;
    --warning: #f59e0b;
    --error: #ef4444;
    
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    
    --border-light: #e5e7eb;
    --border-medium: #d1d5db;
    
    --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);
}

[data-theme="dark"] {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4338ca;
    --secondary: #ec4899;
    --accent: #22d3ee;
    
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-light: #9ca3af;
    
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    
    --border-light: #374151;
    --border-medium: #4b5563;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: all 0.3s ease;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Animated Header */
.animated-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 40px 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    animation: headerSlideIn 0.8s ease-out;
}

@keyframes headerSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(45deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.theme-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.theme-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.main-title {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

.floating-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 6s ease-in-out infinite;
}

.shape-1 {
    width: 80px;
    height: 80px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 60px;
    height: 60px;
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

.shape-3 {
    width: 100px;
    height: 100px;
    bottom: 10%;
    left: 20%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

/* Glassmorphism Effect */
.glassmorphism {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
}

[data-theme="dark"] .glassmorphism {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Dashboard Layout */
.dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 1024px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
}

/* Input Section */
.input-section {
    padding: 30px;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.input-section:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-light);
}

.section-icon {
    font-size: 24px;
    margin-right: 15px;
}

.section-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Form Styles */
.form-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.form-group {
    position: relative;
}

.form-label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.label-icon {
    margin-right: 8px;
    font-size: 16px;
}

.form-input, .form-select {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    font-size: 16px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
    transform: translateY(-2px);
}

.input-hint {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 5px;
    font-style: italic;
}

/* Quick Topics */
.quick-topics {
    margin-bottom: 30px;
}

.quick-topics h4 {
    margin-bottom: 15px;
    color: var(--text-primary);
    font-weight: 600;
}

.topic-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.topic-chip {
    background: var(--primary-light);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.topic-chip:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Generate Button */
.generate-button {
    width: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 18px 30px;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.generate-button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.generate-button:active {
    transform: translateY(-1px);
}

.btn-icon {
    margin-right: 10px;
    font-size: 1.2rem;
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.generate-button:hover .btn-shine {
    left: 100%;
}

/* Preview Section */
.preview-section {
    padding: 30px;
    box-shadow: var(--shadow-lg);
}

.preview-container {
    min-height: 500px;
    position: relative;
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-light);
    text-align: center;
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Loading State */
.loading-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-light);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-bar {
    width: 200px;
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 20px;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
    animation: loading 2s ease-in-out infinite;
}

@keyframes loading {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Case Study Preview */
.case-study-preview {
    display: none;
    background: var(--bg-primary);
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    max-height: 600px;
    overflow-y: auto;
}

.case-study-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid var(--primary);
}

.case-study-title {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 10px;
    font-weight: 800;
}

.case-study-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 300;
}

.study-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 25px 0;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 10px;
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-value {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-top: 5px;
}

.section-title {
    font-size: 1.4rem;
    color: var(--primary);
    margin: 25px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-light);
    font-weight: 700;
}

.step-list {
    list-style: none;
    padding: 0;
}

.step-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 10px;
    border-left: 4px solid var(--primary);
}

.step-number {
    background: var(--primary);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 15px;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.step-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.bullet-list {
    list-style: none;
    padding: 0;
}

.bullet-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
}

.bullet-icon {
    color: var(--success);
    margin-right: 10px;
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Export Section */
.export-section {
    background: var(--bg-primary);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
}

.export-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.export-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 20px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.export-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.export-btn:not(:disabled):hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.pdf-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.word-btn {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
}

.html-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.new-btn {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.export-icon {
    margin-right: 10px;
    font-size: 1.2rem;
}

/* Statistics */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-primary);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease;
    border: 1px solid var(--border-light);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 5px;
}

.stat-label {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: var(--shadow-xl);
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-content {
    display: flex;
    align-items: center;
}

.notification-icon {
    margin-right: 10px;
    font-size: 1.2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .dashboard {
        gap: 20px;
    }
    
    .input-section, .preview-section {
        padding: 20px;
    }
    
    .export-buttons {
        grid-template-columns: 1fr;
    }
    
    .stats-section {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar Styling */
.case-study-preview::-webkit-scrollbar {
    width: 8px;
}

.case-study-preview::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.case-study-preview::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.case-study-preview::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}