/* Custom CSS for TextSummarizer AI */

:root {
    --primary-color: #3b82f6;
    --secondary-color: #8b5cf6;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
}

* {
    box-sizing: border-box;
}

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

/* Gradient Background Animation */
.bg-gradient-to-br {
    background-size: 200% 200%;
    animation: gradientShift 8s ease-in-out infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Glassmorphism Effects */
.backdrop-blur-sm {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.backdrop-blur-sm {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(241, 241, 241, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #2563eb, #7c3aed);
}

/* Enhanced Textarea */
#inputText {
    transition: all 0.3s ease;
    font-size: 1rem;
    line-height: 1.6;
}

#inputText:focus {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.15);
}

/* Button Animations */
button {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

button: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;
}

button:hover:before {
    left: 100%;
}

#summarizeBtn {
    background: linear-gradient(45deg, #3b82f6, #8b5cf6);
    border: none;
    color: white;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

#summarizeBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

#summarizeBtn:active {
    transform: translateY(0);
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading-pulse {
    animation: pulse 2s infinite;
}

/* Progress Bar Animation */
#progressBar {
    transition: width 0.3s ease;
    background: linear-gradient(45deg, #3b82f6, #8b5cf6);
}

/* Stats Cards */
.grid > div {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.grid > div:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Summary Output Styling */
#summaryOutput {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #374151;
}

#summaryOutput p {
    margin-bottom: 1rem;
}

#summaryOutput strong {
    color: #1f2937;
    font-weight: 600;
}

/* Key Insights Cards */
#keyInsights > div {
    transition: all 0.3s ease;
    border-left: 4px solid var(--accent-color);
}

#keyInsights > div:hover {
    background-color: #fef3c7;
    transform: translateX(4px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    .grid-cols-1.md\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-cols-1.md\:grid-cols-3 {
        grid-template-columns: 1fr;
    }
    
    .flex-col.sm\:flex-row {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    h2 {
        font-size: 1.75rem;
    }
    
    .grid-cols-1.md\:grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    .px-6 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --bg-primary: #111827;
        --bg-secondary: #1f2937;
        --border-color: #374151;
    }
}

/* Accessibility improvements */
button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Custom select styling */
select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Text selection */
::selection {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
}

/* Focus states for better accessibility */
input:focus, textarea:focus, select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Animation for results section */
#resultsSection {
    animation: fadeInUp 0.6s ease-out;
}

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

/* Error states */
.error-message {
    background: linear-gradient(45deg, #fee2e2, #fecaca);
    color: #dc2626;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    border-left: 4px solid #dc2626;
}

.success-message {
    background: linear-gradient(45deg, #d1fae5, #a7f3d0);
    color: #059669;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    border-left: 4px solid #059669;
}