@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #121824;
    --bg-card: rgba(18, 24, 38, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.15);
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    
    --accent: #06b6d4;
    --accent-gradient: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    
    --positive: #10b981;
    --positive-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --positive-glow: rgba(16, 185, 129, 0.2);
    
    --negative: #ef4444;
    --negative-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --negative-glow: rgba(239, 68, 68, 0.2);
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.1) 0px, transparent 50%);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: 280px;
    background: rgba(10, 14, 23, 0.85);
    border-right: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px var(--primary-glow);
}

.logo-icon svg {
    color: white;
    width: 22px;
    height: 22px;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 30%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid transparent;
}

.nav-item a svg {
    width: 20px;
    height: 20px;
    transition: var(--transition);
}

.nav-item a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.03);
}

.nav-item.active a {
    color: white;
    background: var(--primary-glow);
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: inset 0 0 12px rgba(99, 102, 241, 0.05);
}

.nav-item.active a svg {
    color: var(--primary);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2.5rem 3rem;
    max-width: 1400px;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.header-title h1 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.25rem;
}

.header-title p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* Stat Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.stat-icon.accent {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent);
}

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

.stat-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Sections */
.dashboard-section {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

.dashboard-section.active {
    display: block;
}

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

/* Glass Cards */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    margin-bottom: 2rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-title svg {
    color: var(--primary);
    width: 20px;
    height: 20px;
}

/* Section Grid (Two columns) */
.section-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

.section-grid-equal {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

/* Tabs for Categories */
.category-tabs {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.35rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.category-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.category-tab:hover {
    color: white;
}

.category-tab.active {
    background: var(--bg-secondary);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Chart Canvas container */
.chart-container {
    position: relative;
    height: 350px;
    width: 100%;
}

/* Comparison Summary Badges */
.metric-summary-box {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.metric-row {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.metric-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.metric-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.metric-scores {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.score-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.score-badge.cnn {
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.score-badge.rnn {
    background: rgba(6, 182, 212, 0.1);
    color: #67e8f9;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.score-badge.winner {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

/* Live Predictor styles */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.input-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.textarea-custom {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    color: white;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    resize: none;
    min-height: 120px;
    transition: var(--transition);
}

.textarea-custom:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.select-custom {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: white;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: var(--transition);
    cursor: pointer;
}

.select-custom:focus {
    outline: none;
    border-color: var(--primary);
}

.select-custom option {
    background: var(--bg-secondary);
    color: white;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.85rem 1.75rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

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

/* Sentiment Results box */
.result-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px dashed var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.01);
}

.result-card.positive {
    background: rgba(16, 185, 129, 0.03);
    border-color: rgba(16, 185, 129, 0.3);
}

.result-card.negative {
    background: rgba(239, 68, 68, 0.03);
    border-color: rgba(239, 68, 68, 0.3);
}

.result-placeholder-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.result-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.result-icon.positive {
    background: var(--positive-gradient);
    color: white;
    box-shadow: 0 0 25px var(--positive-glow);
}

.result-icon.negative {
    background: var(--negative-gradient);
    color: white;
    box-shadow: 0 0 25px var(--negative-glow);
}

.result-sentiment {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.result-sentiment.positive {
    color: var(--positive);
}

.result-sentiment.negative {
    color: var(--negative);
}

.confidence-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    margin: 1.25rem 0 0.5rem 0;
    overflow: hidden;
}

.confidence-bar {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.confidence-bar.positive {
    background: var(--positive-gradient);
}

.confidence-bar.negative {
    background: var(--negative-gradient);
}

.confidence-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Stepper Methodology */
.stepper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    padding-left: 2.5rem;
}

.stepper::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.step {
    position: relative;
}

.step-indicator {
    position: absolute;
    left: -2.5rem;
    top: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    z-index: 2;
    transition: var(--transition);
}

.step.active .step-indicator {
    background: var(--primary-gradient);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 12px var(--primary-glow);
}

.step-content {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    border-radius: 12px;
    transition: var(--transition);
}

.step-content:hover {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.1);
}

.step-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.35rem;
}

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

/* Word Cloud UI and statistics */
.word-cloud-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.word-cloud-image-container {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    position: relative;
    overflow: hidden;
}

.word-cloud-image {
    max-width: 100%;
    max-height: 280px;
    border-radius: 8px;
    object-fit: contain;
}

.word-cloud-fallback {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}

.cloud-word {
    font-weight: 700;
    color: var(--primary);
    opacity: 0.9;
    transition: var(--transition);
    cursor: pointer;
}

.cloud-word:hover {
    transform: scale(1.1);
    opacity: 1;
}

/* Sentiment Words List */
.word-table {
    width: 100%;
    border-collapse: collapse;
}

.word-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.word-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    font-size: 0.9rem;
}

.word-table tr:last-child td {
    border-bottom: none;
}

.sentiment-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.sentiment-dot.positive {
    background: var(--positive);
}

.sentiment-dot.negative {
    background: var(--negative);
}

/* Footer style */
.app-footer {
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
    padding-top: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Mobile Sidebar Drawer Toggle */
.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.5rem;
}

/* Responsive Rules */
@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .section-grid, .section-grid-equal {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 1.5rem 1.5rem;
    }
    .menu-toggle {
        display: block;
    }
    .app-header {
        position: relative;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
