/* Shuttle Tycoon Game Styles */
:root {
    --game-primary: #2ecc71;
    --game-secondary: #e74c3c;
    --game-accent: #3498db;
    --game-warning: #f39c12;
    --game-dark: #2c3e50;
    --game-light: #ecf0f1;
    --game-success: #27ae60;
    --sa-green: #007a4d;
    --sa-gold: #ffb612;
    --sa-black: #000000;
    --sa-blue: #002395;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

#game-container {
    min-height: 100vh;
    padding: 20px 0;
}

.game-section {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.game-section.active {
    display: block;
}

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

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

/* Introduction Section */
.intro-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.game-title {
    font-size: 3rem;
    color: white;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.game-subtitle {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
}

.character-selection {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.character-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.character-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.character-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.character-card.selected {
    border-color: var(--game-primary);
    background: linear-gradient(135deg, var(--game-primary), var(--game-success));
    color: white;
}

.character-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.player-info {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.player-info input,
.player-info select {
    margin: 10px;
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.9);
    min-width: 200px;
}

.game-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
}

.game-btn.primary {
    background: linear-gradient(135deg, var(--game-primary), var(--game-success));
    color: white;
}

.game-btn.secondary {
    background: linear-gradient(135deg, var(--game-accent), #2980b9);
    color: white;
}

.game-btn.tertiary {
    background: linear-gradient(135deg, var(--game-warning), #e67e22);
    color: white;
}

.game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

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

/* Game Stats */
.game-stats {
    display: flex;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.stat {
    text-align: center;
    color: white;
}

.stat-label {
    display: block;
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
}

.stat-value.success {
    color: var(--game-success);
}

/* Old Way Challenge */
.chaos-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.whatsapp-bubble-container,
.spreadsheet-interface,
.manual-routing,
.surprise-events {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 25px;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

.whatsapp-bubble-container h3,
.spreadsheet-interface h3,
.manual-routing h3,
.surprise-events h3 {
    color: white;
    margin-bottom: 15px;
}

#whatsappBubbles {
    max-height: 300px;
    overflow-y: auto;
}

.whatsapp-bubble {
    background: #25d366;
    color: white;
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 10px;
    position: relative;
    animation: slideInLeft 0.3s ease;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }

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

.whatsapp-bubble.urgent {
    background: var(--game-secondary);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

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

.spreadsheet {
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

.spreadsheet-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.spreadsheet-row.header {
    background: var(--game-dark);
    color: white;
    font-weight: bold;
}

.spreadsheet-row.error {
    background: #ffe6e6;
    animation: shake 0.5s;
}

@keyframes shake {

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

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.city-map {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    height: 300px;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.city-map.optimized {
    background: linear-gradient(135deg, #a8e6cf 0%, #dcedc1 100%);
}

.route-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.route-point {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--game-accent);
    border: 3px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: white;
    cursor: move;
    transition: all 0.3s ease;
}

.route-point:hover {
    transform: scale(1.2);
    z-index: 10;
}

.route-point.optimized {
    background: var(--game-primary);
}

.route-line {
    position: absolute;
    background: var(--game-accent);
    height: 3px;
    transform-origin: left center;
    z-index: 1;
}

.route-line.optimized {
    background: var(--game-primary);
}

.challenge-actions {
    text-align: center;
    margin-bottom: 30px;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    height: 30px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, var(--game-primary), var(--game-success));
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

/* Shuttle Genie Upgrade */
.magic-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.magic-map,
.profit-calculator,
.loadshedding-defender,
.capacity-puzzle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

.magic-map h3,
.profit-calculator h3,
.loadshedding-defender h3,
.capacity-puzzle h3 {
    color: white;
    margin-bottom: 20px;
}

.map-controls {
    margin-top: 20px;
    text-align: center;
}

.slider-control {
    margin-bottom: 20px;
}

.slider-control label {
    color: white;
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
}

.slider-control input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.3);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--game-primary);
    cursor: pointer;
}

.profit-projection {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.loadshedding-map {
    background: #333;
    border-radius: 10px;
    height: 200px;
    position: relative;
    overflow: hidden;
}

.loadshedding-zone {
    position: absolute;
    background: rgba(231, 76, 60, 0.6);
    border: 2px solid var(--game-secondary);
    border-radius: 10px;
    animation: flicker 2s infinite;
}

@keyframes flicker {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 0.3;
    }
}

.loadshedding-zone.safe {
    background: rgba(46, 204, 113, 0.6);
    border-color: var(--game-primary);
    animation: none;
}

.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.vehicle {
    background: white;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.vehicle:hover {
    border-color: var(--game-primary);
    transform: translateY(-2px);
}

.vehicle-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.vehicle-seats {
    display: flex;
    justify-content: center;
    gap: 2px;
}

.seat {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ddd;
}

.seat.occupied {
    background: var(--game-accent);
}

/* Achievements */
.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.badge {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.badge.locked {
    opacity: 0.5;
    border-color: rgba(255, 255, 255, 0.2);
}

.badge.unlocked {
    opacity: 1;
    border-color: var(--game-primary);
    animation: unlock 0.5s ease;
}

@keyframes unlock {
    0% {
        transform: scale(0.8) rotate(0deg);
    }

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

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

.badge-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.badge h4 {
    color: white;
    margin-bottom: 10px;
}

.badge p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

/* Business Projection */
.scenario-builder {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 30px;
    backdrop-filter: blur(10px);
}

.scenario-builder h3 {
    color: white;
    margin-bottom: 20px;
}

.scenario-control {
    margin-bottom: 20px;
}

.scenario-control label {
    color: white;
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
}

.scenario-control input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.3);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.projection-results {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin: 30px 0;
}

/* Call to Action */
.cta-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.cta-content h2 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 40px;
}

.personalized-roadmap {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
}

.roadmap-timeline {
    margin: 30px 0;
}

.roadmap-step {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--game-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin-right: 20px;
    flex-shrink: 0;
}

.step-content h4 {
    color: var(--game-primary);
    margin-bottom: 5px;
}

.step-content p {
    color: rgba(255, 255, 255, 0.8);
}

.estimated-impact {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 30px;
    margin-top: 30px;
}

.estimated-impact h3 {
    color: white;
    margin-bottom: 20px;
}

.impact-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.impact-stat {
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
}

.impact-stat.positive {
    background: rgba(46, 204, 113, 0.2);
}

.impact-value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: white;
    margin-bottom: 10px;
}

.impact-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.cta-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}

/* Responsive Design */
@media (max-width: 768px) {

    .chaos-dashboard,
    .magic-dashboard {
        grid-template-columns: 1fr;
    }

    .character-cards {
        grid-template-columns: 1fr;
    }

    .game-stats {
        flex-direction: column;
        gap: 15px;
    }

    .badges-grid {
        grid-template-columns: 1fr;
    }

    .impact-stats {
        grid-template-columns: 1fr;
    }

    .game-title {
        font-size: 2rem;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .game-btn {
        width: 100%;
        max-width: 300px;
    }
}

/* South African Theme Elements */
.sa-theme {
    background: linear-gradient(135deg, var(--sa-green), var(--sa-gold), var(--sa-blue));
}

.sa-badge {
    position: relative;
}

.sa-badge::before {
    content: '🇿🇦';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 20px;
}

/* Load Shedding Specific Styling */
.loadshedding-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--game-warning);
    margin-left: 10px;
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* Custom Scrollbar */
#whatsappBubbles::-webkit-scrollbar {
    width: 8px;
}

#whatsappBubbles::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

#whatsappBubbles::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

#whatsappBubbles::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}