:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --bg-color: #0F172A;
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --positive: #4CAF50;
    --negative: #F44336;
    --neutral: #9E9E9E;
    --subjective: #B667F1;
    --objective: #42A5F5;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Background animated shapes */
.background-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    filter: blur(80px);
    opacity: 0.5;
    border-radius: 50%;
    animation: float 20s infinite ease-in-out alternate;
}

.shape-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, #4F46E5 0%, transparent 70%);
}

.shape-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, #B667F1 0%, transparent 70%);
    animation-delay: -5s;
}

.shape-3 {
    top: 40%;
    left: 40%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, #42A5F5 0%, transparent 70%);
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
}

/* Glassmorphism utility */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.input-section {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-muted);
}

input[type="file"], input[type="text"] {
    width: 100%;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
    font-family: inherit;
    transition: all 0.3s ease;
}

input[type="file"]:focus, input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.3);
}

button {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 70, 229, 0.4);
}

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Examples Section */
.examples-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.examples-section h3 {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 500;
}

.examples-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.example-btn {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--glass-border);
    color: #CBD5E1;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    width: auto;
    font-weight: 400;
}

.example-btn:hover {
    background: rgba(79, 70, 229, 0.2);
    border-color: rgba(79, 70, 229, 0.5);
    color: white;
    transform: translateY(-1px);
    box-shadow: none;
}

.hidden {
    display: none !important;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.tab-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    width: auto;
    flex-shrink: 0;
}

.tab-btn.active {
    background: var(--primary);
    border-color: var(--primary);
}

.back-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    width: auto;
    flex-shrink: 0;
    margin-left: auto; /* Push to right */
    font-size: 0.9rem;
}

.back-btn:hover {
    background: rgba(255,255,255,0.05);
    color: white;
    transform: none;
    box-shadow: none;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-pane.active {
    display: block;
    max-height: 65vh;
    overflow-y: auto;
    padding-right: 10px; /* Space for scrollbar */
}

/* Custom Scrollbar */
.tab-pane::-webkit-scrollbar {
    width: 6px;
}
.tab-pane::-webkit-scrollbar-track {
    background: transparent;
}
.tab-pane::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}
.tab-pane::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}


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

/* Content Areas */
.tab-pane h2 {
    margin-bottom: 1.5rem;
    color: #fff;
}

.markdown-body {
    line-height: 1.7;
    color: #CBD5E1;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    color: #fff;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.markdown-body ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

/* Topics Grid */
.topics-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.topic-tag {
    background: rgba(79, 70, 229, 0.2);
    border: 1px solid rgba(79, 70, 229, 0.4);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s;
}

.topic-tag:hover {
    transform: scale(1.05);
    background: rgba(79, 70, 229, 0.3);
}

.topic-name {
    font-weight: 600;
}

.topic-score {
    background: rgba(0,0,0,0.3);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.8rem;
    color: #A5B4FC;
}

/* Visualizations Grid */
.viz-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.chart-container {
    padding: 1.5rem;
    min-height: 300px;
    display: flex;
    flex-direction: column;
}

.chart-container h3 {
    margin-bottom: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.chart-container.full-width {
    grid-column: 1 / -1;
}

canvas {
    flex-grow: 1;
    width: 100% !important;
    height: 250px !important;
}

@media (max-width: 768px) {
    .viz-grid {
        grid-template-columns: 1fr;
    }
}
