:root {
    --bg-primary: #faf9f7;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e5e5e5;
    --accent: #6366f1;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.dark-mode {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-card: #1f1f1f;
    --text-primary: #f5f5f5;
    --text-secondary: #a1a1a1;
    --text-muted: #6b6b6b;
    --border-color: #2a2a2a;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.app-title {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 2.5rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.app-tagline {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 300;
    font-style: italic;
    font-family: 'Crimson Pro', Georgia, serif;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tooltip-container {
    position: relative;
}

.info-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: help;
    transition: all 0.2s ease;
}

.info-icon:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.tooltip {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-hover);
    width: 280px;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-secondary);
    z-index: 100;
    animation: fadeIn 0.2s ease;
}

.mode-toggle {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.mode-toggle:hover {
    border-color: var(--accent);
    transform: scale(1.05);
}

/* Controls */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.categories {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.category-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Space Grotesk', sans-serif;
}

.category-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

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

.controls-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.shuffle-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Space Grotesk', sans-serif;
}

.shuffle-btn:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Concept Grid */
.concept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    flex: 1;
}

.concept-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.concept-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #ec4899);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.concept-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.concept-card:hover::before {
    opacity: 1;
}

.concept-card.explored {
    border-color: rgba(16, 185, 129, 0.3);
}

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

.card-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 500;
}

.explored-badge {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #10b981;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.card-title {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 1.4rem;
    font-weight: 400;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.concept-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.concept-canvas {
    border-radius: 8px;
    background: var(--bg-secondary);
}

.concept-slider {
    width: 100%;
    max-width: 240px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border-color);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.concept-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.concept-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.concept-insight {
    font-family: 'Crimson Pro', Georgia, serif;
    font-style: italic;
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-align: center;
    padding-top: 0.5rem;
    animation: fadeIn 0.5s ease;
}

.toggle-btn, .add-node-btn, .release-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Space Grotesk', sans-serif;
}

.toggle-btn:hover, .add-node-btn:hover, .release-btn:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

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

.release-btn {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.release-btn:hover {
    background: #059669;
    border-color: #059669;
}

.add-node-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Focus Mode */
.focus-mode {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
}

.close-focus {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-focus:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.focus-card {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: var(--shadow-hover);
    border: 1px solid var(--border-color);
    max-width: 500px;
    text-align: center;
    animation: scaleIn 0.3s ease;
}

.focus-card .card-title {
    font-size: 2rem;
    margin-bottom: 2rem;
}

.focus-card .concept-canvas {
    width: 100%;
    max-width: 360px;
    height: auto;
}

.explored-check {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #10b981;
    color: white;
    font-size: 0.8rem;
    line-height: 24px;
    margin-left: 0.5rem;
}

/* Celebration */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
    animation: fadeIn 0.5s ease;
}

.celebration-content {
    background: var(--bg-card);
    padding: 3rem 4rem;
    border-radius: 24px;
    text-align: center;
    animation: scaleIn 0.5s ease;
}

.celebration-content h2 {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.celebration-content p {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.celebration-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

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

.footer-quote {
    font-family: 'Crimson Pro', Georgia, serif;
    font-style: italic;
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.footer-divider {
    color: var(--text-muted);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { 
        opacity: 0;
        transform: scale(0.9);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
    }
    
    .app-title {
        font-size: 1.8rem;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .categories {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        flex-wrap: nowrap;
    }
    
    .category-btn {
        white-space: nowrap;
    }
    
    .controls-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .concept-grid {
        grid-template-columns: 1fr;
    }
    
    .concept-card {
        padding: 1.25rem;
    }
    
    .focus-card {
        margin: 1rem;
        padding: 2rem 1.5rem;
    }
    
    .close-focus {
        top: 1rem;
        right: 1rem;
    }
    
    .tooltip {
        right: -100px;
        width: 250px;
    }
}

@media (max-width: 480px) {
    .concept-canvas {
        width: 100% !important;
        max-width: 260px;
    }
}