/* IAPro - Jarvis Theme */
/* Gradient: #1e40af → #06b6d4, Background: #ffffff */

:root {
    --primary-start: #1e40af;
    --primary-end: #06b6d4;
    --background: #ffffff;
    --surface: #f8fafc;
    --surface-alt: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow: rgba(30, 64, 175, 0.1);
    --card-bg: #ffffff;
    --header-gradient: linear-gradient(135deg, #1e40af 0%, #06b6d4 100%);
}

/* Dark Mode */
body.dark {
    --background: #0f172a;
    --surface: #1e293b;
    --surface-alt: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
    --shadow: rgba(6, 182, 212, 0.15);
    --card-bg: #1e293b;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

/* Header */
.header {
    background: var(--header-gradient);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px var(--shadow);
}

.header-content h1 {
    font-size: 2rem;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.header-content .subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Navigation */
.nav-tabs {
    display: flex;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    overflow-x: auto;
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--primary-end);
}

.tab-btn.active {
    color: var(--primary-start);
    border-bottom-color: var(--primary-start);
    font-weight: 600;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 200px);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

/* Search */
.search-container {
    position: relative;
    margin: 2rem 0;
}

#search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

#search-input:focus {
    outline: none;
    border-color: var(--primary-end);
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.15);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-top: 0.5rem;
    box-shadow: 0 10px 40px var(--shadow);
    display: none;
    z-index: 100;
    max-height: 400px;
    overflow-y: auto;
}

.search-results.show {
    display: block;
}

.results-list {
    padding: 0.5rem;
}

.result-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.result-item:hover {
    background: var(--surface);
}

.result-category {
    display: inline-block;
    background: var(--header-gradient);
    color: #fff;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.result-content {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.no-results {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px var(--shadow);
}

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

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

/* Welcome Card */
.welcome-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    border-left: 4px solid var(--primary-end);
}

.welcome-card h2 {
    color: var(--primary-start);
    margin-bottom: 0.5rem;
}

.welcome-card p {
    color: var(--text-secondary);
}

/* Charts */
.charts-section {
    margin: 3rem 0;
}

.charts-section h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.chart-container {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px var(--shadow);
}

/* Knowledge Cards */
.content-cards {
    display: grid;
    gap: 1.5rem;
}

.knowledge-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px var(--shadow);
}

.knowledge-card h3 {
    color: var(--primary-start);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.knowledge-card ul {
    list-style: none;
    padding-left: 0;
}

.knowledge-card li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
}

.knowledge-card li strong {
    color: var(--text-primary);
}

.topic-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--surface);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.topic-name {
    font-weight: 600;
    color: var(--primary-start);
}

.topic-count {
    color: var(--primary-end);
    font-weight: 500;
}

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

.member-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.member-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px var(--shadow);
}

.member-avatar {
    width: 60px;
    height: 60px;
    background: var(--header-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.member-name {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.member-messages {
    color: var(--primary-end);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.member-topics {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}

.member-sample {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-style: italic;
    background: var(--surface);
    padding: 0.75rem;
    border-radius: 8px;
}

/* Questions */
.questions-container {
    display: grid;
    gap: 1.5rem;
}

.question-category {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px var(--shadow);
}

.question-category h3 {
    color: var(--primary-start);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.question-category ul {
    list-style: none;
}

.question-category li {
    padding: 0.75rem 0;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.question-category li:last-child {
    border-bottom: none;
}

/* Resources */
.resources-list {
    display: grid;
    gap: 1rem;
}

.resource-card {
    display: block;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.resource-card:hover {
    transform: translateX(8px);
    box-shadow: 0 4px 20px var(--shadow);
    border-color: var(--primary-end);
}

.resource-card h3 {
    color: var(--primary-start);
    margin-bottom: 0.5rem;
}

.resource-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.resource-link {
    color: var(--primary-end);
    font-size: 0.8rem;
    word-break: break-all;
}

/* Section Titles */
.tab-content h2 {
    color: var(--primary-start);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.tab-content h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
}

/* Footer */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.footer-note {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .nav-tabs {
        padding: 0 1rem;
    }
    
    .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .members-grid {
        grid-template-columns: 1fr;
    }
}

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

::-webkit-scrollbar-track {
    background: var(--surface);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-end);
}