:root {
    --primary-color: #EE0000;
    --secondary-color: #000000;
    --success-color: #28a745;
    --dark-bg: #1a1a1a;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 100px 0;
    margin-bottom: 50px;
}

.feature-card, .path-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.feature-card ul li, .path-card ol li {
    padding: 5px 0;
}

.feature-card ul li i {
    margin-right: 8px;
}

.navbar-brand i {
    color: var(--primary-color);
}

.content-section {
    padding: 40px 0;
}

.sidebar {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.sidebar .list-group-item {
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.sidebar .list-group-item:hover,
.sidebar .list-group-item.active {
    border-left-color: var(--primary-color);
    background-color: #f8f9fa;
}

.code-section {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

pre {
    background-color: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
}

code {
    color: #e83e8c;
}

pre code {
    color: #f8f8f2;
}

.editor-container {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0;
}

#editor {
    height: 400px;
    width: 100%;
}

#inventory-editor {
    height: 150px;
    width: 100%;
}

.output-container {
    background-color: #2d2d2d;
    color: #0f0;
    padding: 15px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.output-container.error {
    color: #ff4444;
}

.output-container.success {
    color: #00ff00;
}

.btn-run {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-run:hover {
    background-color: #cc0000;
    border-color: #cc0000;
    color: white;
}

.alert-custom {
    border-left: 4px solid var(--primary-color);
}

.lab-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.lab-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.difficulty-badge {
    font-size: 0.8rem;
    padding: 4px 8px;
}

footer {
    margin-top: auto;
}

.table-of-contents {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.table-of-contents a {
    text-decoration: none;
    color: #333;
    display: block;
    padding: 5px 0;
    transition: color 0.3s ease;
}

.table-of-contents a:hover {
    color: var(--primary-color);
}

.tip-box {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.warning-box {
    background-color: #f8d7da;
    border-left: 4px solid #dc3545;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.info-box {
    background-color: #d1ecf1;
    border-left: 4px solid #0dcaf0;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.2em;
}

/* Learn dropdown menu - Desktop default */
.learn-dropdown-menu {
    min-width: 500px;
}

@media (max-width: 768px) {
    .hero-section {
        padding: 50px 0;
    }

    .sidebar {
        position: relative;
        top: 0;
    }

    /* Mobile-friendly Learn dropdown menu */
    .navbar-nav .learn-dropdown-menu,
    .navbar-nav .dropdown-menu {
        min-width: 100% !important;
        max-width: 100vw !important;
        width: 100% !important;
        position: static !important;
        border: none;
        box-shadow: none;
        margin: 0 !important;
        padding: 0.5rem 0 !important;
        max-height: 70vh;
        overflow-y: auto;
    }

    /* Single column layout on mobile */
    .navbar-nav .dropdown-menu .row {
        flex-direction: column !important;
    }

    .navbar-nav .dropdown-menu .col-md-6 {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }

    /* Better spacing for mobile */
    .navbar-nav .dropdown-menu .dropdown-item {
        padding: 0.75rem 1.5rem;
        font-size: 1rem !important;
    }

    .navbar-nav .dropdown-menu .dropdown-header {
        padding: 1rem 1.5rem 0.5rem;
        font-size: 0.95rem !important;
        font-weight: bold;
        color: var(--primary-color);
    }

    .navbar-nav .dropdown-menu .dropdown-divider {
        margin: 0.75rem 0;
    }

    /* Ensure dropdown is visible and accessible */
    .navbar-collapse .dropdown-menu.show {
        display: block;
        background-color: #2b2b2b;
    }

    .navbar-collapse .dropdown-item {
        color: rgba(255, 255, 255, 0.85);
    }

    .navbar-collapse .dropdown-item:hover,
    .navbar-collapse .dropdown-item:focus {
        background-color: rgba(255, 255, 255, 0.1);
        color: white;
    }
}

/* Tablet-specific adjustments (768px - 992px) */
@media (min-width: 768px) and (max-width: 992px) {
    .navbar-nav .learn-dropdown-menu {
        min-width: 600px !important;
        max-width: 90vw !important;
    }

    .navbar-nav .dropdown-menu .dropdown-item {
        font-size: 0.9rem !important;
        padding: 0.5rem 1rem;
    }

    .navbar-nav .dropdown-menu .dropdown-header {
        font-size: 0.85rem !important;
    }
}
