/* pointer.css - C++ Pointer Hunter memory game styles */
body {
    background-color: #f8fafc;
    margin: 0;
    font-family: 'Inter', sans-serif;
}

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

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

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

.btn-back:hover {
    color: #4f46e5;
}

.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;
}

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

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

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

/* Stats panel */
.pointer-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-indigo {
    color: #6366f1;
}

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

/* Arena Grid Layout */
.pointer-arena {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 20px;
    margin-bottom: 15px;
}

/* IDE Simulator Styling */
.ide-simulator {
    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: 310px;
}

.ide-header {
    background: #1e293b;
    padding: 10px 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: 15px 20px;
    color: #f8fafc;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 1.05rem;
    line-height: 1.6;
    overflow-y: auto;
    height: calc(100% - 41px);
    box-sizing: border-box;
}

/* IDE Code Colors (Syntax Highlighting) */
.cpp-keyword { color: #f43f5e; font-weight: bold; }
.cpp-type { color: #38bdf8; }
.cpp-comment { color: #64748b; font-style: italic; }
.cpp-var { color: #fbbf24; }
.cpp-num { color: #a855f7; }

/* Memory panel styling */
.memory-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 20px;
    text-align: left;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    height: 310px;
    box-sizing: border-box;
}

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

.ram-grid {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.ram-cell {
    flex-grow: 1;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    transition: all 0.3s;
}

.ram-cell.highlight {
    background: rgba(99, 102, 241, 0.1);
    border-color: #6366f1;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.2);
}

.cell-addr {
    font-size: 0.65rem;
    font-weight: 700;
    color: #64748b;
    font-family: 'Consolas', monospace;
    display: block;
    margin-bottom: 4px;
}

.cell-name {
    font-size: 0.8rem;
    font-weight: 800;
    color: #1e293b;
    display: block;
}

.cell-val {
    font-size: 1.1rem;
    font-weight: 800;
    color: #6366f1;
    font-family: 'Consolas', monospace;
}

/* Question container */
.question-box {
    background: #f8fafc;
    border: 1px dashed #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.question-badge {
    background: #6366f1;
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
}

.question-text {
    margin: 0;
    font-weight: 700;
    color: #334155;
    font-size: 0.95rem;
}

/* Multiple choice buttons */
.choices-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.choice-btn {
    background: white;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.choice-btn:hover {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-1px);
}

.choice-btn.correct {
    background: #ecfdf5 !important;
    border-color: #10b981 !important;
    color: #047857 !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.choice-btn.wrong {
    background: #fef2f2 !important;
    border-color: #ef4444 !important;
    color: #b91c1c !important;
    animation: choiceShake 0.4s ease-in-out;
}

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

/* Modal Styling & Result Overrides */
.result-rank-box {
    color: #4f46e5;
    background: #e0e7ff;
    border-color: #818cf8;
    font-size: 1.4rem;
    font-weight: 800;
    margin: 20px 0;
    padding: 15px;
    border-radius: 10px;
    border: 2px dashed #818cf8;
    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(99, 102, 241, 0.3);
    border-radius: 4px;
}

.modal-scroll-body::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

.btn-restart {
    background: #6366f1;
    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: #4f46e5;
}

.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) {
    .pointer-arena {
        grid-template-columns: 1fr;
    }
    .ide-simulator, .memory-panel {
        height: auto;
    }
}
