/* oop.css - C# OOP Inheritance tree game styles */
body {
    background-color: #f8fafc;
    margin: 0;
    font-family: 'Inter', sans-serif;
}

.oop-container {
    max-width: 950px;
    margin: 15px auto;
    padding: 10px 20px;
    text-align: center;
}

.oop-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.btn-back {
    text-decoration: none;
    color: #f97316;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.btn-back:hover {
    color: #ea580c;
}

.btn-help {
    background: none;
    border: none;
    color: #64748b;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.btn-help:hover {
    color: #475569;
}

.oop-title-area {
    margin-bottom: 10px;
}

.oop-title {
    font-size: 1.8rem;
    color: #1e293b;
    font-weight: 800;
    margin: 0;
}

.oop-title span {
    color: #f97316;
    font-weight: 300;
    display: block;
    font-size: 1.1rem;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Stats panel */
.oop-stats {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 12px 20px;
    margin-bottom: 15px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-item .label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-item .value {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1e293b;
}

.stat-item .value.text-orange {
    color: #f97316;
}

.stat-item .value.text-red {
    color: #ef4444;
}

/* Arena layout */
.oop-arena {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 20px;
    margin-bottom: 15px;
}

/* Diagram Panel (Left) */
.class-tree-panel {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 15px;
    text-align: left;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    height: 330px;
    box-sizing: border-box;
}

.panel-subtitle {
    margin: 0 0 10px 0;
    color: #1e293b;
    font-size: 1.05rem;
    font-weight: 700;
}

.diagram-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    position: relative;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    padding: 10px;
    overflow: hidden;
}

.diagram-node {
    background: white;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 800;
    color: #334155;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    position: relative;
    z-index: 10;
    transition: all 0.2s;
}

.diagram-node.active {
    border-color: #f97316;
    background: #fff7ed;
    color: #c2410c;
    box-shadow: 0 4px 10px rgba(249, 115, 22, 0.15);
}

.diagram-line {
    width: 2px;
    height: 15px;
    background: #cbd5e1;
    position: relative;
    z-index: 5;
}

/* IDE & Question Panel (Right) */
.oop-code-panel {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
    text-align: left;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
    height: 330px;
    display: flex;
    flex-direction: column;
}

.ide-header {
    background: #1e293b;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #334155;
}

.ide-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-red { background-color: #ef4444; }
.dot-yellow { background-color: #f59e0b; }
.dot-green { background-color: #10b981; }

.ide-title {
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 700;
    margin-left: 8px;
    font-family: 'Courier New', Courier, monospace;
}

.ide-body {
    padding: 12px 15px;
    color: #f8fafc;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.88rem;
    line-height: 1.4;
    overflow-y: auto;
    flex-grow: 1;
}

/* C# Code Colors */
.cs-keyword { color: #f43f5e; font-weight: bold; }
.cs-type { color: #38bdf8; }
.cs-comment { color: #64748b; font-style: italic; }
.cs-var { color: #fbbf24; }
.cs-str { color: #a7f3d0; }

/* Question and choices container */
.oop-code-panel .question-box {
    background: #1e293b;
    border: none;
    border-top: 1px solid #334155;
    border-radius: 0;
    margin-bottom: 0;
    padding: 8px 15px;
}

.oop-code-panel .question-badge {
    background: #f97316;
}

.oop-code-panel .question-text {
    color: #cbd5e1;
    font-size: 0.88rem;
}

.oop-code-panel .choices-grid {
    padding: 10px 15px;
    background: #1e293b;
    border-top: 1px solid #334155;
}

.choice-btn {
    background: #0f172a;
    border: 1px solid #475569;
    color: #cbd5e1;
    padding: 8px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.choice-btn:hover {
    border-color: #f97316;
    background: rgba(249, 115, 22, 0.1);
}

.choice-btn.correct {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: #10b981 !important;
    color: #34d399 !important;
}

.choice-btn.wrong {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: #ef4444 !important;
    color: #f87171 !important;
    animation: oopShake 0.4s ease-in-out;
}

@keyframes oopShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

/* Modal Styling & Result Overrides */
.result-rank-box {
    color: #ea580c;
    background: #fff7ed;
    border-color: #fdba74;
    font-size: 1.4rem;
    font-weight: 800;
    margin: 20px 0;
    padding: 15px;
    border-radius: 10px;
    border: 2px dashed #fdba74;
    text-align: center;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.show {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.glass-panel-modal {
    background: rgba(255, 255, 255, 0.96);
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: slideUp 0.4s ease-out;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close-x {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 26px;
    font-weight: 700;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    padding: 5px;
    z-index: 10;
}

.modal-close-x:hover {
    color: #ef4444;
}

.modal-scroll-body {
    max-height: 220px;
    overflow-y: auto;
    padding-right: 8px;
    margin-bottom: 15px;
}

.modal-scroll-body::-webkit-scrollbar {
    width: 6px;
}

.modal-scroll-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.modal-scroll-body::-webkit-scrollbar-thumb {
    background: rgba(249, 115, 22, 0.3);
    border-radius: 4px;
}

.modal-scroll-body::-webkit-scrollbar-thumb:hover {
    background: rgba(249, 115, 22, 0.5);
}

.btn-restart {
    background: #f97316;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-restart:hover {
    background: #ea580c;
}

.btn-share {
    background: #e2e8f0;
    color: #334155;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-share:hover {
    background: #cbd5e1;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@media (max-width: 800px) {
    .oop-arena {
        grid-template-columns: 1fr;
    }
    .class-tree-panel, .oop-code-panel {
        height: auto;
    }
}
