/* Q Bloom Builder - Advanced Styles */
:root {
    /* Light Theme */
    --primary-color: #4776E6;
    --secondary-color: #8E54E9;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --border-color: #e2e8f0;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    
    /* Bloom's Taxonomy Colors */
    --remember: #3498db;
    --understand: #2ecc71;
    --apply: #f1c40f;
    --analyze: #e67e22;
    --evaluate: #e74c3c;
    --create: #9b59b6;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #4776E6 0%, #8E54E9 100%);
    --gradient-success: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    --gradient-warning: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
    --gradient-danger: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

[data-theme="dark"] {
    --background-color: #1a202c;
    --surface-color: #2d3748;
    --text-primary: #f7fafc;
    --text-secondary: #cbd5e0;
    --border-color: #4a5568;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background-color);
    color: var(--text-primary);
    transition: all 0.3s ease;
    line-height: 1.6;
}

.q-bloom-builder-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.theme-btn {
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow);
}

.theme-btn:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
}

/* Header Styles */
.q-bloom-builder-header {
    background: var(--gradient-primary);
    color: white;
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
}

.q-bloom-builder-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" fill="rgba(255,255,255,0.1)"><circle cx="50" cy="50" r="2"/></svg>');
    animation: float 20s infinite linear;
}

@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    100% { transform: translateY(-100px) rotate(360deg); }
}

.header-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}

.main-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.title-text {
    font-size: 3rem;
    font-weight: 700;
}

.title-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

.subtitle {
    font-size: 1.3rem;
    opacity: 0.9;
    margin-bottom: 30px;
}

.header-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Main Content */
.q-bloom-builder-main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

@media (max-width: 1024px) {
    .q-bloom-builder-main {
        grid-template-columns: 1fr;
    }
}

/* Section Styles */
.input-section, .results-section {
    background: var(--surface-color);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    font-size: 1.8rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-actions {
    display: flex;
    gap: 10px;
}

/* Input Container */
.input-container {
    position: relative;
    margin-bottom: 20px;
}

#questionInput {
    width: 100%;
    min-height: 200px;
    padding: 20px;
    border: 2px solid var(--border-color);
    border-radius: 15px;
    font-size: 1rem;
    resize: vertical;
    background: var(--surface-color);
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-family: inherit;
}

#questionInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(71, 118, 230, 0.1);
    transform: translateY(-2px);
}

.input-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Button Styles */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 25px;
}

.btn {
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:active {
    transform: scale(0.95);
}

.btn.primary {
    background: var(--gradient-primary);
    color: white;
}

.btn.secondary {
    background: var(--surface-color);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn.success {
    background: var(--gradient-success);
    color: white;
}

.btn.warning {
    background: var(--gradient-warning);
    color: white;
}

.btn.danger {
    background: var(--gradient-danger);
    color: white;
}

.btn-icon {
    font-size: 1.2rem;
}

/* Results Summary */
.results-summary {
    display: flex;
    gap: 20px;
}

.summary-item {
    text-align: center;
    padding: 15px;
    background: var(--background-color);
    border-radius: 12px;
    min-width: 80px;
}

.summary-item.highlight {
    background: var(--gradient-primary);
    color: white;
}

.summary-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.summary-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--surface-color);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.stat-icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--background-color);
}

.stat-content h3 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.stat-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Bloom Levels Grid */
.bloom-levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.bloom-card {
    border-radius: 15px;
    padding: 25px;
    color: white;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.bloom-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
}

.bloom-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.bloom-card h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.questions-list {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
}

.questions-list::-webkit-scrollbar {
    width: 6px;
}

.questions-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.questions-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.questions-list li {
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    border-left: 3px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.questions-list li:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateX(5px);
}

/* Color Classes for Bloom Cards */
.bloom-card.remember { background: var(--remember); }
.bloom-card.understand { background: var(--understand); }
.bloom-card.apply { background: var(--apply); }
.bloom-card.analyze { background: var(--analyze); }
.bloom-card.evaluate { background: var(--evaluate); }
.bloom-card.create { background: var(--create); }

/* Visualization */
.visualization-section {
    background: var(--surface-color);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
}

.visualization-section h3 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bloom-chart {
    display: flex;
    height: 60px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.chart-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.chart-segment:hover {
    filter: brightness(1.1);
    transform: scale(1.05);
    z-index: 2;
}

.chart-segment::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.chart-segment:hover::before {
    left: 100%;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: var(--background-color);
    border-radius: 20px;
    font-size: 0.9rem;
}

.legend-color {
    width: 15px;
    height: 15px;
    border-radius: 50%;
}

/* AI Recommendations */
.ai-recommendations {
    background: var(--surface-color);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid var(--border-color);
}

.ai-recommendations h3 {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.recommendations-content {
    background: var(--background-color);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
}

/* Footer */
.q-bloom-builder-footer {
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 30px 20px;
    margin-top: 50px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-brand h3 {
    color: var(--primary-color);
    margin-bottom: 5px;
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--primary-color);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        transform: translate3d(0,-30px,0);
    }
    70% {
        transform: translate3d(0,-15px,0);
    }
    90% {
        transform: translate3d(0,-4px,0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .q-bloom-builder-main {
        padding: 15px;
        gap: 20px;
    }
    
    .input-section, .results-section {
        padding: 20px;
    }
    
    .title-text {
        font-size: 2rem;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .results-summary {
        flex-direction: column;
        gap: 10px;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .header-stats {
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .main-title {
        flex-direction: column;
        gap: 10px;
    }
    
    .title-text {
        font-size: 1.8rem;
    }
    
    .bloom-levels-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Utility Classes */
.fade-in {
    animation: fadeInUp 0.6s ease;
}

.pulse {
    animation: pulse 2s infinite;
}

.bounce {
    animation: bounce 1s;
}

.hidden {
    display: none !important;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Print Styles */
@media print {
    .theme-toggle,
    .action-buttons,
    .footer-links {
        display: none !important;
    }
    
    .q-bloom-builder-container {
        box-shadow: none !important;
    }
    
    .bloom-card {
        break-inside: avoid;
    }
}