/* ProbabiliQuest - La Città del Caso CSS */
:root {
    --bg-base: #0a0e17;
    /* Deep Navy, night city */
    --accent-cyan: #00f0ff;
    --accent-pink: #ff007f;
    --accent-yellow: #ffcf00;
    --text-primary: #e0e6ed;
    --text-secondary: #94a3b8;

    --glass-bg: rgba(20, 30, 48, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --glass-blur: blur(12px);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-base);
    background-image: radial-gradient(circle at 15% 50%, rgba(0, 240, 255, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(255, 0, 127, 0.15), transparent 25%);
    background-size: cover;
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
.logo-text,
.stat-label {
    font-family: var(--font-heading);
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
}

.glass-header {
    background: rgba(10, 14, 23, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Typography */
.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 0 10px var(--accent-pink));
    animation: float 3s ease-in-out infinite;
}

.logo-text h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-pink));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    margin: 0;
}

.subtitle {
    font-size: 0.8rem;
    color: var(--accent-yellow);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 600;
}

/* Profile Stats */
.user-stats {
    display: flex;
    gap: 1.5rem;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.stat-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.2);
}

.stat-icon {
    font-size: 1.5rem;
}

.stat-details {
    display: flex;
    flex-direction: column;
}

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

.stat-value {
    font-weight: 700;
    font-size: 0.9rem;
}

.progress-bar-bg {
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    margin: 4px 0;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-cyan), #00ff88);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Layout */
.main-layout {
    display: flex;
    height: calc(100vh - 80px);
    padding: 1.5rem;
    gap: 1.5rem;
}

/* Sidebar */
.sidebar {
    width: 260px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.nav-menu {
    list-style: none;
}

.nav-item {
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(0, 240, 255, 0.1);
    color: var(--accent-cyan);
    border-left: 4px solid var(--accent-cyan);
    transform: translateX(4px);
}

.class-goal {
    background: rgba(255, 207, 0, 0.05);
    padding: 1rem;
    border-radius: 12px;
    border: 1px dashed rgba(255, 207, 0, 0.3);
}

.class-goal h4 {
    color: var(--accent-yellow);
    margin-bottom: 0.5rem;
}

.class-goal p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Main Content Area */
.content-area {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    position: relative;
}

/* Map View */
.app-explanation {
    background: rgba(0, 240, 255, 0.05);
    border-left: 4px solid var(--accent-cyan);
    padding: 1.5rem;
    margin-top: 1rem;
    border-radius: 8px;
}

.app-explanation p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
}

.app-explanation ul {
    margin-left: 1.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
}

.app-explanation li {
    margin-bottom: 0.4rem;
}

.districts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.district-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.district-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 240, 255, 0.15);
    border-color: rgba(0, 240, 255, 0.5);
}

.district-image {
    height: 140px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.district-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, rgba(10, 14, 23, 0.9), transparent);
}

.mercante-bg {
    background-image: url('mercante_bg.png');
}

.lab-bg {
    background-image: url('lab_bg.png');
}

.semafori-bg {
    background-image: url('semafori_bg.png');
}

.arciere-bg {
    background-image: url('arciere_bg.png');
}

.casino-bg {
    background-image: url('casino_bg.png');
}

.district-info {
    padding: 1.2rem;
}

.district-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
    color: #fff;
}

.district-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.tags {
    display: flex;
    gap: 8px;
}

.tag {
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 12px;
    background: rgba(0, 240, 255, 0.2);
    color: var(--accent-cyan);
    font-weight: 600;
}

.tag.locked {
    background: rgba(255, 255, 255, 0.1);
    color: #777;
}

/* Mission Layout */
.mission-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

.mission-stages {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.mission-stages::before {
    content: '';
    position: absolute;
    top: 50%;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 0;
}

.stage-step {
    background: var(--bg-base);
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    z-index: 1;
    transition: var(--transition);
}

.stage-step.active {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

.stage-step.completed {
    border-color: #00ff88;
    color: #00ff88;
    background: rgba(0, 255, 136, 0.1);
}

.mission-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* UI Elements */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(45deg, var(--accent-pink), #ff4d4d);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 0, 127, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 127, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9rem;
    color: var(--accent-cyan);
    font-weight: 500;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--accent-pink);
    cursor: pointer;
    margin-top: -8px;
    box-shadow: 0 0 10px var(--accent-pink);
}

input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    color: white;
    font-family: var(--font-body);
    resize: vertical;
    min-height: 100px;
}

textarea:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

/* Multiple Choice Questions */
.mcq-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mcq-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.mcq-option:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-cyan);
}

.mcq-option input[type="radio"] {
    margin-top: 4px;
    accent-color: var(--accent-pink);
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.mcq-option label {
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    flex: 1;
}

.simulation-area {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    min-height: 300px;
}

.chart-container {
    width: 100%;
    max-width: 600px;
    height: 300px;
}

.feedback-msg {
    padding: 1rem;
    border-radius: 8px;
    background: rgba(0, 255, 136, 0.1);
    border-left: 4px solid #00ff88;
    color: #e0e6ed;
    animation: fadeIn 0.5s ease;
}

.feedback-msg.error {
    background: rgba(255, 0, 127, 0.1);
    border-color: var(--accent-pink);
}

.anim-dice {
    font-size: 4rem;
    animation: roll 0.5s ease infinite;
    display: inline-block;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes roll {
    0% {
        transform: rotate(0deg) scale(1);
    }

    50% {
        transform: rotate(180deg) scale(1.2);
    }

    100% {
        transform: rotate(360deg) scale(1);
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 10px;
    padding-left: 200px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--glass-border);
    margin-top: 10px;
    background: rgba(10, 14, 23, 0.8);
    backdrop-filter: blur(20px);
}

.app-footer a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.app-footer a:hover {
    color: var(--accent-pink);
    text-shadow: 0 0 10px rgba(255, 0, 127, 0.6);
}