:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-glass: rgba(26, 26, 46, 0.7);
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-tertiary: #ec4899;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-glass: rgba(255, 255, 255, 0.1);
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    --gradient-glass: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animated Background */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.bg-animation::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(139, 92, 246, 0.08) 0%, transparent 40%);
    animation: bgMove 30s ease-in-out infinite;
}

@keyframes bgMove {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 15, 26, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
    padding: 1rem 2rem;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    -webkit-text-fill-color: white;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--text-primary);
}

/* Main Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 8rem 2rem 4rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 0;
    margin-bottom: 4rem;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.stat-card {
    background: var(--gradient-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

/* Section Styles */
.section {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 32px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

/* API Endpoint Cards */
.endpoint-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.endpoint-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.endpoint-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
    border-color: rgba(99, 102, 241, 0.3);
}

.endpoint-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.method-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.method-post {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.method-get {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.endpoint-path {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.endpoint-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.endpoint-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

/* Interactive Tester */
.tester-section {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 2rem;
    margin-top: 3rem;
}

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

.tester-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.endpoint-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.endpoint-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s;
}

.endpoint-btn:hover,
.endpoint-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.request-builder {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .request-builder {
        grid-template-columns: 1fr;
    }
    .endpoint-grid {
        grid-template-columns: 1fr;
    }
    .hero h1 {
        font-size: 2.5rem;
    }
    .hero-stats {
        gap: 1rem;
    }
}

.builder-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.5rem;
}

.panel-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

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

.form-label {
    display: block;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
    transition: border-color 0.3s;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.form-textarea {
    min-height: 200px;
    resize: vertical;
}

.btn-primary {
    padding: 0.75rem 2rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.response-panel {
    position: relative;
}

.response-output {
    background: var(--bg-primary);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 1rem;
    min-height: 200px;
    max-height: 400px;
    overflow: auto;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Code Examples */
.code-section {
    margin-top: 3rem;
}

.code-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-glass);
    flex-wrap: wrap;
}

.code-tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: color 0.3s;
    border-bottom: 2px solid transparent;
}

.code-tab:hover,
.code-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent-primary);
}

.code-block {
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1.5rem;
    overflow-x: auto;
    position: relative;
}

.code-block pre {
    margin: 0;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

.code-block code {
    color: #e2e8f0;
}

/* Copy Button */
.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: rgba(255,255,255,0.2);
    color: var(--text-primary);
}

/* Syntax Highlighting */
.comment { color: #64748b; }
.string { color: #a5b4fc; }
.keyword { color: #c084fc; }
.function { color: #60a5fa; }
.number { color: #34d399; }
.variable { color: #f472b6; }

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.toggle-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s;
}

.toggle-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* Visual Cards */
.visual-container {
    display: none;
    max-height: 400px;
    overflow-y: auto;
}

.visual-container.active {
    display: block;
}

.plan-card {
    background: var(--gradient-glass);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

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

.plan-title {
    font-size: 1.25rem;
    font-weight: 600;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.plan-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.meta-value {
    font-weight: 600;
    color: var(--text-primary);
}

.day-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

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

.day-number {
    font-weight: 600;
    color: var(--accent-primary);
}

.day-date {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.session-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.session-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 8px;
    font-size: 0.875rem;
}

.session-time {
    font-weight: 600;
    color: var(--accent-primary);
    min-width: 50px;
}

.session-topic {
    flex: 1;
}

.session-subject {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.complexity-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.complexity-low { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.complexity-medium { background: rgba(234, 179, 8, 0.2); color: #eab308; }
.complexity-high { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

/* User Profile */
.profile-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.5rem;
    align-items: start;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.profile-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.stat-box {
    text-align: center;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.stat-box-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.stat-box-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Topics */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.topic-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s;
}

.topic-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.topic-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.topic-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
}

/* Quiz */
.quiz-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.quiz-question {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quiz-option {
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.quiz-option:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--accent-primary);
}

/* XP Bar */
.xp-bar {
    background: var(--bg-secondary);
    border-radius: 8px;
    height: 8px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.xp-fill {
    background: var(--gradient-primary);
    height: 100%;
    border-radius: 8px;
    transition: width 0.5s ease;
}

/* Export */
.export-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.btn-export {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-export:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* Success Message */
.success-message {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: none;
}

.success-message.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Footer */
footer {
    border-top: 1px solid var(--border-glass);
    padding: 3rem 2rem;
    margin-top: 4rem;
    text-align: center;
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--accent-primary);
}

/* ============================================
   NEW: Endpoint Categories & Auth UI
   ============================================ */

/* Auth Status Bar */
.auth-status-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
}

.auth-indicator {
    font-size: 0.875rem;
    font-weight: 500;
}

.auth-indicator.authenticated {
    color: #22c55e;
}

.btn-small {
    padding: 0.375rem 0.75rem;
    background: var(--accent-primary);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-small:hover {
    background: var(--accent-secondary);
}

/* Endpoint Categories */
.endpoint-categories {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.endpoint-category {
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    overflow: hidden;
}

.endpoint-category.collapsed .endpoint-selector {
    display: none;
}

.endpoint-category.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    cursor: pointer;
    transition: background 0.3s;
    font-weight: 500;
}

.category-header:hover {
    background: rgba(99, 102, 241, 0.1);
}

.category-icon {
    font-size: 1.25rem;
}

.toggle-icon {
    margin-left: auto;
    transition: transform 0.3s;
    font-size: 0.75rem;
}

.endpoint-category .endpoint-selector {
    padding: 0.75rem;
    border-top: 1px solid var(--border-glass);
    background: rgba(15, 15, 26, 0.5);
}

/* Endpoint Info & Badges */
.endpoint-info {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-glass);
}

.endpoint-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.category-badge {
    padding: 0.25rem 0.5rem;
    background: var(--gradient-glass);
    border: 1px solid var(--accent-primary);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--accent-primary);
    font-weight: 500;
}

.auth-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.auth-required {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.auth-public {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.endpoint-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Method badges in inputs */
.method-post {
    color: #22c55e !important;
    font-weight: 600;
}

.method-get {
    color: #3b82f6 !important;
    font-weight: 600;
}

.method-put {
    color: #f59e0b !important;
    font-weight: 600;
}

.method-delete {
    color: #ef4444 !important;
    font-weight: 600;
}

/* Auth Warning */
.auth-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #fca5a5;
}

.auth-warning a {
    color: #6366f1;
    text-decoration: underline;
}

.warning-icon {
    font-size: 1rem;
}

/* Auth Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.modal-tab {
    flex: 1;
    padding: 0.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-glass);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
}

.modal-tab.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}
