/* donanim.css - Computer Hardware matching game styles */
body {
    background-color: #f8fafc;
    margin: 0;
    font-family: 'Inter', sans-serif;
}

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

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

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

.btn-back:hover {
    color: #7c3aed;
}

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

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

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

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

.hardware-desc {
    color: #64748b;
    font-size: 0.95rem;
    max-width: 650px;
    margin: 8px auto 0 auto;
    line-height: 1.4;
}

/* Stats panel */
.hardware-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-purple {
    color: #a855f7;
}

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

/* Prompt Box */
.prompt-box {
    background: rgba(168, 85, 247, 0.05);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 16px;
    padding: 15px 25px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 20px;
    text-align: left;
}

.prompt-icon {
    width: 48px;
    height: 48px;
    background: rgba(168, 85, 247, 0.15);
    border-radius: 50%;
    color: #a855f7;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.prompt-content {
    flex-grow: 1;
}

.prompt-badge {
    background: #a855f7;
    color: white;
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.prompt-text {
    color: #1e293b;
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

/* Assembly Motherboard Arena */
.assembly-arena {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.motherboard {
    width: 100%;
    max-width: 600px;
    height: 320px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border: 3px solid #334155;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.3);
}

.motherboard-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 30% 40%, rgba(168, 85, 247, 0.15) 0%, transparent 60%),
        linear-gradient(rgba(51, 65, 85, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(51, 65, 85, 0.3) 1px, transparent 1px);
    background-size: 100% 100%, 20px 20px, 20px 20px;
}

/* Sockets on the motherboard */
.hardware-slot {
    position: absolute;
    background: rgba(30, 41, 59, 0.8);
    border: 2px dashed #475569;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}

.hardware-slot:hover {
    border-color: #a855f7;
    background: rgba(168, 85, 247, 0.1);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
    transform: scale(1.05);
}

.slot-marker {
    font-size: 1.4rem;
    color: #475569;
    margin-bottom: 4px;
    transition: color 0.3s;
}

.hardware-slot:hover .slot-marker {
    color: #a855f7;
}

.slot-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Slot positions on Motherboard */
.slot-cpu {
    top: 50px;
    left: 80px;
    width: 100px;
    height: 100px;
}

.slot-ram {
    top: 40px;
    left: 210px;
    width: 50px;
    height: 120px;
}

.slot-gpu {
    bottom: 40px;
    left: 80px;
    width: 200px;
    height: 60px;
}

.slot-ssd {
    top: 80px;
    right: 80px;
    width: 120px;
    height: 45px;
}

.slot-psu {
    bottom: 30px;
    right: 40px;
    width: 110px;
    height: 90px;
}

/* Success/Error status glows */
.hardware-slot.correct {
    border-style: solid;
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.15) !important;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5) !important;
}

.hardware-slot.correct .slot-marker {
    color: #10b981 !important;
}

.hardware-slot.correct .slot-label {
    color: #34d399 !important;
}

.hardware-slot.wrong {
    animation: slotShake 0.4s ease-in-out;
    border-style: solid;
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.15) !important;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.5) !important;
}

.hardware-slot.wrong .slot-marker {
    color: #ef4444 !important;
}

.hardware-slot.wrong .slot-label {
    color: #f87171 !important;
}

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

/* Modal Styling */
.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;
}

.result-rank-box {
    font-size: 1.4rem;
    font-weight: 800;
    color: #7c3aed;
    margin: 20px 0;
    padding: 15px;
    background: #f5f3ff;
    border-radius: 10px;
    border: 2px dashed #c084fc;
}

.btn-restart {
    background: #a855f7;
    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: #7c3aed;
}

.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-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(168, 85, 247, 0.3);
    border-radius: 4px;
}

.modal-scroll-body::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.5);
}

@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: 600px) {
    .hardware-stats {
        flex-direction: column;
        gap: 10px;
    }
    .motherboard {
        height: 420px;
    }
    /* Reposition slots in narrow viewport */
    .slot-cpu { top: 30px; left: 30px; }
    .slot-ram { top: 30px; right: 30px; left: auto; }
    .slot-gpu { bottom: 150px; left: 30px; width: 150px; }
    .slot-ssd { top: 180px; right: 30px; }
    .slot-psu { bottom: 20px; left: 30px; right: 30px; width: auto; }
}
