/* Scrum Vision Game Styles */
:root {
    --vision-primary: #22d3ee;
    --vision-secondary: #f59e0b;
    --vision-accent: #34d399;
    --vision-danger: #f97316;
    --vision-bg: #0b1b2b;
    --vision-glass: rgba(12, 23, 34, 0.75);
    --vision-border: rgba(148, 163, 184, 0.2);
}

.vision-game-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    /* Crucial for scrolling inside flex */
    gap: 0.5rem;
    padding: 0.5rem;
    color: #f8fafc;
    background: radial-gradient(circle at top left, #0f2c3b, #081422 55%, #060b14);
    border-radius: 12px;
    overflow: hidden;
}

.vision-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--vision-border);
}

.vision-header h2 {
    font-size: 1.4rem;
}

.vision-stats {
    display: flex;
    gap: 1rem;
}

.stat-box {
    background: var(--vision-glass);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--vision-border);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vision-main-stage {
    flex: 1;
    display: flex;
    gap: 0.75rem;
    overflow: hidden;
    min-height: 0;
    /* Enable shrinking */
}

.vision-canvas-area {
    flex: 2;
    background: linear-gradient(135deg, rgba(6, 10, 18, 0.9), rgba(10, 24, 32, 0.7));
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--vision-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    gap: 0;
}

.city-preview {
    width: 100%;
    height: 100%;
    background: url('../assets/city-blueprint.png') no-repeat center;
    background-size: contain;
    filter: drop-shadow(0 0 24px rgba(34, 211, 238, 0.3));
    transition: transform 0.5s ease;
    object-fit: contain;
}

.vision-sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    padding-right: 0.2rem;
    min-width: 320px;
    max-width: 380px;
}

.vision-card {
    background: var(--vision-glass);
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--vision-border);
    transition: all 0.3s ease;
    cursor: pointer;
    /* Indicate clickability */
}

.vision-card:hover {
    transform: translateY(-2px);
    border-color: rgba(34, 211, 238, 0.6);
}

.ceremony-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 2rem;
    text-align: center;
}

.vision-btn {
    background: var(--vision-primary);
    color: #0b1b2b;
    /* Dark text for contrast on bright cyan */
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(34, 211, 238, 0.2);
}

.vision-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(34, 211, 238, 0.3);
    color: #0b1b2b;
    /* Ensure text stays dark on hover */
}

.vision-btn.secondary {
    background: rgba(34, 211, 238, 0.05);
    border: 1px solid var(--vision-primary);
    color: var(--vision-primary);
    /* Ensure text is visible and matches border */
    font-weight: 700;
    text-shadow: 0 0 10px rgba(34, 211, 238, 0.2);
}

.vision-btn.secondary:hover {
    background: rgba(34, 211, 238, 0.15);
    color: #fff;
    /* White text on hover for better contrast */
    border-color: var(--vision-primary);
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.2);
}

.vision-btn.ghost {
    background: transparent;
    border: 1px dashed rgba(148, 163, 184, 0.4);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: #cbd5e1;
    /* Lighter text for ghost buttons */
}

.vision-btn.ghost:hover {
    border-color: var(--vision-primary);
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.vision-progress {
    width: 95%;
    margin-top: 1rem;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #cbd5f5;
    margin-bottom: 0.5rem;
}

.progress-track {
    width: 100%;
    height: 8px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--vision-primary), var(--vision-secondary));
    border-radius: 999px;
    transition: width 0.4s ease;
}

.vision-hint {
    margin-top: 1rem;
    color: #cbd5e1;
    font-size: 0.95rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.vision-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 0 0 auto;
    /* Let it be its natural size */
    padding-right: 0.2rem;
}

/* Custom Scrollbar for Vision Sidebar */
.vision-sidebar::-webkit-scrollbar {
    width: 6px;
}

.vision-sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.vision-sidebar::-webkit-scrollbar-thumb {
    background: var(--vision-primary);
    border-radius: 10px;
}

.vision-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--vision-accent);
}

.vision-meta {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-top: 0.4rem;
}

.vision-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: auto;
    /* Push to bottom if space permits */

    /* Sticky footer for buttons */
    position: sticky;
    bottom: -0.5rem;
    /* Match sidebar padding */
    background: rgba(11, 27, 43, 0.98);
    /* Semi-transparent dark background */
    backdrop-filter: blur(12px);
    padding: 1.25rem 0.75rem 0.75rem 0.75rem;
    /* Add padding for breathing room */
    z-index: 10;
    border-top: 1px solid rgba(34, 211, 238, 0.2);
    margin: 1rem -0.2rem -0.75rem -0.75rem;
    /* Negative margins to flush with sidebar edges but without width overflow */
    width: calc(100% + 0.4rem);
}

.capacity-box {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.3);
    font-size: 0.9rem;
}

.vision-summary {
    background: rgba(8, 16, 24, 0.6);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.vision-checklist,
.vision-steps {
    margin: 0.8rem 0 0;
    padding-left: 1.2rem;
    color: #e2e8f0;
    font-size: 0.9rem;
}

.vision-muted {
    font-size: 0.85rem;
    color: #94a3b8;
}

.vision-card.compact {
    padding: 0.5rem 0.75rem;
}

.vision-onboarding {
    max-width: 520px;
    padding: 2rem;
}

.vision-onboarding h2 {
    margin-top: 0;
    color: var(--vision-primary);
}

.vision-instructions {
    text-align: left;
    background: rgba(8, 16, 24, 0.6);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    margin: 1.5rem 0;
}

.vision-callout {
    background: rgba(16, 185, 129, 0.12);
    border: 1px dashed rgba(16, 185, 129, 0.6);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.85rem;
}

.vision-callout strong {
    color: #d1fae5;
    font-weight: 700;
}

.vision-alert {
    width: 100%;
    text-align: center;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.vision-alert.info {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
}

.vision-alert.warning {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
}

.vision-alert.danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
}

/* Animations */
@keyframes buildProgress {
    0% {
        transform: scale(0.9);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Animations */
@keyframes buildProgress {
    0% {
        transform: scale(0.9);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.building-item {
    animation: buildProgress 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.h-full {
    height: 100%;
}

/* Tutorial & UI New Styles */
.tutorial-modal {
    max-width: 600px;
    padding: 2.5rem;
    position: relative;
    background: #0f172a;
    border: 1px solid var(--vision-primary);
    border-radius: 20px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.tutorial-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.4));
}

.tutorial-dots {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin: 2rem 0;
}

.dot {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transition: all 0.3s;
}

.dot.active {
    background: var(--vision-primary);
    transform: scale(1.2);
    box-shadow: 0 0 8px var(--vision-primary);
}

.tutorial-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: auto;
}

.city-element {
    background: rgba(6, 78, 59, 0.6);
    padding: 0.6rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--vision-accent);
    color: #d1fae5;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.3rem;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.city-element::before {
    content: '🏗️';
}

.empty-state-city {
    color: #ffffff;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.6;
    background: rgba(15, 23, 42, 0.85);
    padding: 2rem;
    border-radius: 16px;
    border: 2px dashed rgba(34, 211, 238, 0.3);
    backdrop-filter: blur(8px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    max-width: 80%;
    margin: 0 auto;
}

.animate-pop {
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}