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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

/* Game Container */
.game-container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

/* Game Header */
.game-header {
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
    color: white;
    padding: 20px 30px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
}

.game-header h1 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 25px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.stat:hover {
    transform: translateY(-2px);
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: bold;
}

/* Main Content */
.game-main {
    flex: 1;
    padding: 30px;
    position: relative;
}

/* Screens */
.screen {
    display: none;
    animation: fadeIn 0.4s ease-in;
}

.screen.active {
    display: block;
}

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

/* Welcome Screen */
#welcome-screen {
    text-align: center;
    padding: 40px 20px;
}

#welcome-screen h2 {
    font-size: 3rem;
    color: #2980b9;
    margin-bottom: 30px;
}

#welcome-screen > p {
    font-size: 1.25rem;
    color: #666;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Learning Paths */
.learning-paths {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.path-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.docker-path {
    border-color: #0db7ed;
}

.kubernetes-path {
    border-color: #326ce5;
}

.path-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.15);
}

.path-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #333;
}

.path-card p {
    color: #666;
    margin-bottom: 20px;
}

.path-card ul {
    list-style: none;
    text-align: left;
}

.path-card li {
    padding: 8px 0;
    color: #555;
    position: relative;
    padding-left: 25px;
}

.path-card li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #27ae60;
    font-weight: bold;
}

/* Tutorial Screen */
.tutorial-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
}

.tutorial-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.tutorial-progress {
    font-size: 1rem;
    color: #666;
    background: #f0f0f0;
    padding: 8px 16px;
    border-radius: 20px;
}

.tutorial-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #444;
}

.concept-box, .example-box {
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
}

.concept-box h4, .example-box h4 {
    color: #2980b9;
    margin-bottom: 10px;
}

.comparison-table {
    overflow-x: auto;
    margin: 20px 0;
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.comparison-table th {
    background: #3498db;
    color: white;
    padding: 12px;
    text-align: left;
}

.comparison-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.comparison-table tr:hover {
    background: #f8f9fa;
}

.code-example {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    overflow-x: auto;
}

.code-example pre {
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem;
}

.try-it {
    background: #e8f5e9;
    border: 2px dashed #4caf50;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.tutorial-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    gap: 20px;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 14px 35px;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(52, 152, 219, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(52, 152, 219, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #ecf0f1;
    color: #2c3e50;
}

.btn-secondary:hover {
    background: #bdc3c7;
}

.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.875rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: #34495e;
    color: white;
    transition: background 0.3s ease;
}

.btn-small:hover {
    background: #2c3e50;
}

/* Challenge Container */
.challenge-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

#challenge-title {
    color: #2980b9;
    margin-bottom: 25px;
    font-size: 2rem;
}

.challenge-content {
    font-size: 1.25rem;
    line-height: 1.6;
    margin-bottom: 30px;
    color: #4a5568;
}

/* Challenge Options */
.challenge-options {
    display: grid;
    gap: 20px;
}

.option-btn {
    padding: 20px 25px;
    border: 2px solid #e0e7ff;
    background: white;
    border-radius: 12px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.option-btn:hover:not(:disabled) {
    background: #f7fafc;
    border-color: #3498db;
    transform: translateX(5px);
}

.option-btn:disabled {
    cursor: not-allowed;
}

.option-btn.correct {
    background: #d4edda;
    border-color: #28a745;
    animation: pulse 0.5s ease;
}

.option-btn.incorrect {
    background: #f8d7da;
    border-color: #dc3545;
    animation: shake 0.5s ease;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Explanation */
.explanation {
    margin-top: 25px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #3498db;
}

.explanation p {
    margin-bottom: 15px;
    color: #4a5568;
    line-height: 1.6;
}

/* YAML Editor Screen */
.editor-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
}

.editor-instructions {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.editor-instructions p {
    font-size: 1.125rem;
    color: #555;
}

.editor-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.editor-section {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.editor-section h3 {
    background: #f5f5f5;
    padding: 15px 20px;
    margin: 0;
    font-size: 1.125rem;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.CodeMirror {
    height: 400px;
    font-size: 14px;
}

.yaml-preview {
    padding: 20px;
    margin: 0;
    height: 400px;
    overflow-y: auto;
    background: #f8f9fa;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.6;
}

.editor-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.validation-result {
    margin-top: 20px;
}

.success-message, .error-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 500;
}

.success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Sandbox Screen */
.sandbox-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
}

.sandbox-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.tab-btn {
    padding: 10px 25px;
    border: none;
    background: #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: #3498db;
    color: white;
}

.tab-btn:hover:not(.active) {
    background: #d0d0d0;
}

.sandbox-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.terminal-container {
    background: #1e1e1e;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.terminal-header {
    background: #2d2d2d;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ccc;
    font-size: 0.875rem;
}

.terminal-output {
    padding: 20px;
    min-height: 400px;
    max-height: 400px;
    overflow-y: auto;
    color: #0f0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.4;
}

.terminal-line {
    margin-bottom: 5px;
}

.terminal-input {
    display: flex;
    padding: 15px 20px;
    background: #2d2d2d;
    border-top: 1px solid #444;
}

.prompt {
    color: #0f0;
    margin-right: 10px;
    font-family: 'Courier New', Courier, monospace;
}

#terminal-command {
    flex: 1;
    background: transparent;
    border: none;
    color: #0f0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    outline: none;
}

.sandbox-help {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
}

.sandbox-help h3 {
    margin-bottom: 15px;
    color: #333;
}

.sandbox-help ul {
    list-style: none;
}

.sandbox-help li {
    padding: 8px 0;
}

.sandbox-help code {
    background: #e0e0e0;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
}

/* Progress Container */
.progress-container {
    margin-top: 30px;
}

.progress-bar {
    height: 25px;
    background: #e0e7ff;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db 0%, #2980b9 100%);
    width: 0%;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.progress-text {
    text-align: center;
    color: #666;
    font-size: 1rem;
}

/* Learning Path Visualization */
.path-visualization {
    padding: 30px;
}

.path-section {
    margin-bottom: 50px;
}

.path-section h3 {
    margin-bottom: 25px;
    color: #333;
    font-size: 1.5rem;
}

.path-nodes {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.path-node {
    position: relative;
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 50%;
    width: 100px;
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.path-node.completed {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

.path-node.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.path-node:hover:not(.locked) {
    transform: scale(1.1);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.node-number {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.node-name {
    font-size: 0.75rem;
    text-align: center;
}

.path-connector {
    width: 50px;
    height: 3px;
    background: #e0e0e0;
    transition: background 0.3s ease;
}

.path-connector.completed {
    background: #28a745;
}

/* Achievements */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.achievement-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.achievement-card.unlocked {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    color: white;
    border-color: #fda085;
}

.achievement-card.locked {
    opacity: 0.6;
    filter: grayscale(100%);
}

.achievement-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
}

.achievement-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
}

.achievement-card h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.achievement-card p {
    font-size: 0.875rem;
    margin-bottom: 5px;
}

.achievement-xp {
    font-size: 0.75rem;
    opacity: 0.8;
    font-weight: 600;
}

/* Leaderboard */
.leaderboard-list {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin: 20px 0;
}

.leaderboard-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e7ff;
    transition: all 0.3s ease;
}

.leaderboard-entry:last-child {
    border-bottom: none;
}

.leaderboard-entry.highlight {
    background: linear-gradient(135deg, #e0f2ff 0%, #cfe2ff 100%);
    border-radius: 10px;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.2);
}

.rank {
    font-size: 1.5rem;
    color: #3498db;
    font-weight: bold;
    min-width: 60px;
}

.name {
    flex: 1;
    margin: 0 20px;
    font-size: 1.125rem;
}

.score {
    color: #2980b9;
    font-weight: 600;
    font-size: 1.25rem;
}

/* Navigation */
.game-nav {
    background: #f8f9fa;
    border-top: 1px solid #e0e7ff;
    display: flex;
    justify-content: space-around;
    padding: 15px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.nav-btn {
    background: none;
    border: none;
    padding: 12px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border-radius: 12px;
}

.nav-btn:hover {
    background: #e0e7ff;
}

.nav-icon {
    font-size: 1.75rem;
}

.nav-label {
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    font-weight: 600;
    z-index: 1000;
    font-size: 1.1rem;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: #28a745;
    color: white;
}

.notification.error {
    background: #dc3545;
    color: white;
}

.notification.achievement {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border: none;
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease;
}

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

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #000;
}

#modal-title {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5rem;
}

#modal-body {
    font-size: 1.125rem;
    line-height: 1.6;
    color: #555;
}

#modal-body .btn-primary {
    margin-top: 20px;
}

/* Game Complete */
.game-complete {
    text-align: center;
    padding: 50px;
}

.game-complete h2 {
    font-size: 3rem;
    color: #3498db;
    margin-bottom: 25px;
}

.final-stats {
    background: #f8f9fa;
    padding: 40px;
    border-radius: 20px;
    margin: 30px 0;
}

.final-stats p {
    font-size: 1.25rem;
    margin: 15px 0;
    color: #4a5568;
}

.final-stats strong {
    color: #3498db;
    font-size: 1.75rem;
}

.certificate {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    color: white;
    padding: 40px;
    border-radius: 20px;
    margin: 30px 0;
    box-shadow: 0 10px 30px rgba(253, 160, 133, 0.3);
}

.certificate h3 {
    font-size: 2rem;
    margin-bottom: 15px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .editor-wrapper {
        grid-template-columns: 1fr;
    }
    
    .sandbox-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .game-container {
        max-width: 100%;
        min-height: 100vh;
    }
    
    .game-header h1 {
        font-size: 2rem;
    }
    
    .stats-bar {
        gap: 10px;
    }
    
    .stat {
        padding: 8px 15px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    #welcome-screen h2 {
        font-size: 2.5rem;
    }
    
    .learning-paths {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .achievements-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
    }
    
    .path-node {
        width: 80px;
        height: 80px;
    }
    
    .node-number {
        font-size: 1.25rem;
    }
    
    .nav-btn {
        padding: 10px 15px;
    }
    
    .nav-icon {
        font-size: 1.5rem;
    }
    
    .nav-label {
        font-size: 0.75rem;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        transform: translateY(-100px);
    }
    
    .notification.show {
        transform: translateY(0);
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Print Styles */
@media print {
    .game-nav, .btn-primary, .btn-secondary, .notification {
        display: none;
    }
    
    .game-container {
        box-shadow: none;
    }
}