/* Premium Tech Company Styling for IntelliDoc */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600;700&display=swap');

:root {
    /* Light Theme Variables */
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #10b981;
    --secondary-dark: #059669;
    --accent-color: #7c3aed;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --shadow-sm: 0 1px 2px 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);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --gradient-bg: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    --header-gradient: linear-gradient(to right, var(--primary-color), var(--accent-color));
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --secondary-color: #10b981;
    --secondary-dark: #059669;
    --accent-color: #8b5cf6;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --bg-primary: #1e293b;
    --bg-secondary: #0f172a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --gradient-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --header-gradient: linear-gradient(to right, #3b82f6, #8b5cf6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'JetBrains Mono', 'Inter', monospace;
    background: var(--gradient-bg);
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    transition: all 0.3s ease;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--bg-secondary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.theme-toggle i {
    font-size: 1.2rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.container {
    width: 100%;
    max-width: 1200px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: all 0.3s ease;
}

header {
    background: var(--header-gradient);
    background-size: 200% 200%;
    animation: gradientAnimation 10s ease infinite;
    color: white;
    padding: 2.5rem 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

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

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;charset=utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"%3E%3Cpath fill="%23ffffff" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,186.7C384,213,480,235,576,213.3C672,192,768,128,864,128C960,128,1056,192,1152,213.3C1248,235,1344,213,1392,202.7L1440,192L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"%3E%3C/path%3E%3C/svg%3E');
    background-size: cover;
    background-position: center;
    opacity: 0.3;
}

header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
    position: relative;
}

header p {
    font-size: 1.2rem;
    font-weight: 400;
    opacity: 0.9;
    position: relative;
}

main {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    transition: all 0.3s ease;
}

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

.upload-area {
    background: var(--bg-primary);
    border: 2px dashed rgba(37, 99, 235, 0.3);
    transition: all 0.3s ease;
    border-radius: var(--radius-lg);
    padding: 3rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
    transform: translateY(-2px);
}

.upload-area.drag-over {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
    transform: scale(1.01);
}

.upload-area i {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.upload-area p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.upload-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    margin-top: 1rem;
    font-family: 'JetBrains Mono', monospace;
}

.upload-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

input[type="file"] {
    display: none;
}

.or-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-secondary);
    font-weight: 500;
}

.or-divider::before,
.or-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(100, 116, 139, 0.2);
}

.or-divider span {
    padding: 0 1rem;
}

.text-input-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

textarea {
    width: 100%;
    height: 180px;
    padding: 1.25rem;
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-radius: var(--radius-md);
    resize: none;
    font-size: 1rem;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.3s ease;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

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

.analyze-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    margin-top: 1rem;
    width: 100%;
    font-family: 'JetBrains Mono', monospace;
    background-image: linear-gradient(to right, var(--primary-color), var(--accent-color));
    background-size: 200% auto;
}

.analyze-btn:hover {
    background-position: right center;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Results Section Styles */
.results-section {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2.5rem;
    display: none;
    border: 1px solid rgba(100, 116, 139, 0.1);
    transition: all 0.3s ease;
}

.results-section h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--text-primary);
    position: relative;
    padding-bottom: 0.75rem;
}

.results-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(37, 99, 235, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

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

.loader p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.results-container {
    display: none;
}

.result-card {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.result-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.result-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

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

.sentiment {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
}

.sentiment.positive {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--secondary-color);
}

.sentiment.negative {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.sentiment.neutral {
    background-color: rgba(100, 116, 139, 0.1);
    color: var(--text-secondary);
}

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    background-color: var(--bg-primary);
    border-top: 1px solid rgba(100, 116, 139, 0.1);
    transition: all 0.3s ease;
    font-family: 'JetBrains Mono', monospace;
}

/* Responsive Styles */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
    
    .container {
        border-radius: var(--radius-md);
    }
    
    header {
        padding: 2rem 1.5rem;
    }
    
    header h1 {
        font-size: 2.2rem;
    }
    
    main {
        padding: 2rem 1.5rem;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .upload-area i {
        font-size: 2.5rem;
    }
    
    .results-section {
        padding: 1.5rem;
    }
}

/* Animation for results */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Glassmorphism effect for cards */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

/* Header accent */
.header-accent {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color), var(--secondary-color));
    background-size: 200% auto;
    animation: gradientAnimation 5s ease infinite;
    opacity: 0.7;
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 500;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    display: none;
    transform: translateY(-20px);
    opacity: 0;
}

.notification.info {
    background-color: var(--primary-color);
}

.notification.success {
    background-color: var(--secondary-color);
}

.notification.error {
    background-color: #ef4444;
}

.notification.warning {
    background-color: #f59e0b;
}

.notification-show {
    animation: slideIn 0.3s forwards;
}

.notification-hide {
    animation: slideOut 0.3s forwards;
}

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

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

/* Footer link styles */
footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

footer a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}