/* ========== COMPONENT STYLES ========== */
/* Buttons, cards, forms, tabs, and other reusable components */

/* ========== BUTTONS ========== */

.btn {
    display: block;
    padding: 14px 28px;
    border-radius: 10px;
    text-decoration: none;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow);
    border: none;
    cursor: pointer;
}

.btn:active {
    transform: scale(0.98);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--white);
    color: var(--secondary);
    border: 2px solid var(--gold);
}

.btn-small {
    padding: 12px 24px;
    font-size: 1rem;
}

.btn-nowrap {
    white-space: nowrap;
}

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

.remove-btn {
    background: var(--primary);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 16px;
}

/* ========== MENU ========== */

.menu {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: auto;
    margin-bottom: auto;
}

/* ========== CARDS ========== */

.card {
    background: var(--white);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 12px;
}

.card h2 {
    color: var(--secondary);
    margin-bottom: 16px;
    font-size: 1.5rem;
}

/* ========== FORM ELEMENTS ========== */

input, textarea, select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 12px;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--secondary);
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--secondary);
}

/* ========== TABS ========== */

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

.tab {
    flex: 1;
    padding: 12px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    color: var(--white);
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.tab.active {
    background: var(--white);
    color: var(--secondary);
    font-weight: 600;
}

/* ========== PROGRESS INDICATOR ========== */

.progress {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 20px 0;
}

.progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--white);
}

.progress-dot.current {
    background: var(--gold);
    border-color: var(--gold);
    box-shadow: 0 0 8px var(--gold);
}

/* ========== QR SCANNER ========== */

.scanner-container {
    background: var(--dark);
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 1;
    position: relative;
    width: 100%;
}

#qr-reader {
    width: 100% !important;
}

#qr-reader video {
    border-radius: 16px;
}

/* ========== QR DISPLAY ========== */

.qr-display {
    text-align: center;
    padding: 20px;
}

.qr-display canvas {
    max-width: 100%;
    border-radius: 8px;
}

.qr-label {
    margin-top: 16px;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--secondary);
}

/* ========== STATUS MESSAGES ========== */

.status {
    text-align: center;
    padding: 40px 20px;
    color: var(--white);
}

.status h2 {
    color: var(--gold);
    margin-bottom: 16px;
}

.status p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* ========== CLUE DISPLAY ========== */

.clue-box {
    background: var(--gray);
    border-left: 4px solid var(--primary);
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    font-size: 1.1rem;
    line-height: 1.5;
    font-style: italic;
    margin: 12px 0;
}

/* ========== EMPTY STATE ========== */

.empty-state {
    color: #666;
    text-align: center;
    margin-bottom: 16px;
}

/* ========== HOTSPOT INDICATOR ========== */

.hotspot-indicator {
    position: absolute;
    border: 3px solid var(--gold);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    box-shadow: 0 0 0 6px rgba(212, 175, 55, 0.4),
                0 0 25px rgba(212, 175, 55, 0.5);
    animation: pulse-hotspot 2s ease-in-out infinite;
}

@keyframes pulse-hotspot {
    0%, 100% {
        box-shadow: 0 0 0 6px rgba(212, 175, 55, 0.4),
                    0 0 25px rgba(212, 175, 55, 0.5);
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        box-shadow: 0 0 0 16px rgba(212, 175, 55, 0.25),
                    0 0 40px rgba(212, 175, 55, 0.6);
        transform: translate(-50%, -50%) scale(1.15);
    }
}

/* ========== HOTSPOT MARKER (Admin) ========== */

.hotspot-marker {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid var(--primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    box-shadow: 0 0 0 4px rgba(196, 30, 58, 0.3);
}

/* ========== LOADER ========== */

.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
}

.loader-snowflakes {
    display: flex;
    gap: 8px;
}

.loader::after {
    content: 'Loading...';
    color: var(--gold);
    font-size: 1rem;
}

.btn .loader {
    padding: 0;
    flex-direction: row;
    gap: 8px;
}

.btn .loader::after {
    display: none;
}

.loader-snowflakes::before,
.loader-snowflakes::after,
.loader-snowflakes span::before {
    content: '❄';
    font-size: 1.5rem;
    color: var(--white);
    animation: snowflake-fade 1.2s ease-in-out infinite;
}

.loader-snowflakes::after {
    animation-delay: 0.2s;
}

.loader-snowflakes span::before {
    animation-delay: 0.4s;
}

@keyframes snowflake-fade {
    0%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========== RESPONSIVE ========== */

@media (min-width: 768px) {
    .scanner-container {
        max-width: 350px;
        margin: 0 auto;
    }
}

@media (min-width: 500px) {
    .menu {
        flex-direction: row;
        justify-content: center;
        gap: 20px;
    }

    .menu .btn {
        min-width: 180px;
    }
}
