/**
 * AugustCS2 Quest — Frontend CSS
 * Cinematic Dark Theme
 */

/* ══ Reset & Base ══ */
.aq-page-wrapper {
    background: linear-gradient(135deg, #0b0e17 0%, #111827 50%, #0b0e17 100%);
    min-height: 100vh;
    padding: 40px 0 80px;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    color: #e5e7eb;
}

.aq-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ══ Page Header ══ */
.aq-page-header {
    text-align: center;
    margin-bottom: 48px;
}

.aq-main-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #fff;
    margin: 0 0 12px;
}

.aq-glow {
    background: linear-gradient(90deg, #4CC9F0, #E63946);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

.aq-subtitle {
    color: #9ca3af;
    font-size: 1rem;
    margin: 0;
}

/* ══ Login Required / Empty ══ */
.aq-login-required,
.aq-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
}

.aq-lock-icon,
.aq-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.aq-login-required h2,
.aq-empty-state h2 {
    color: #fff;
    margin-bottom: 8px;
}

/* ══ Quest Grid ══ */
.aq-quest-grid {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ══ Quest Card ══ */
.aq-quest-card {
    background: linear-gradient(145deg, rgba(17,24,39,0.95), rgba(30,41,59,0.9));
    border: 1px solid rgba(76,201,240,0.15);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.aq-quest-card:hover {
    transform: translateY(-2px);
    border-color: rgba(76,201,240,0.35);
    box-shadow: 0 8px 32px rgba(76,201,240,0.1);
}

.aq-quest-card.aq-completed {
    border-color: rgba(34,197,94,0.3);
    opacity: 0.85;
}

.aq-quest-thumb {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: #0f172a;
}

.aq-quest-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.aq-quest-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 64px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
}

.aq-quest-badge-done {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(34,197,94,0.9);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(8px);
}

.aq-quest-info {
    padding: 24px;
}

.aq-quest-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 6px;
}

.aq-quest-desc {
    color: #9ca3af;
    font-size: 0.9rem;
    margin: 0 0 8px;
}

.aq-quest-deadline {
    font-size: 0.8rem;
    color: #f59e0b;
    font-weight: 600;
    margin-bottom: 16px;
    padding: 6px 12px;
    background: rgba(245,158,11,0.1);
    border: 1px solid rgba(245,158,11,0.2);
    border-radius: 6px;
    display: inline-block;
}

/* ══ Progress Bar ══ */
.aq-progress-bar {
    position: relative;
    height: 26px;
    background: rgba(255,255,255,0.06);
    border-radius: 13px;
    overflow: hidden;
    margin-bottom: 20px;
}

.aq-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CC9F0, #06b6d4);
    border-radius: 13px;
    transition: width 0.5s ease;
}

.aq-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* ══ Task List ══ */
.aq-task-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.aq-task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    transition: background 0.2s, border-color 0.2s;
}

.aq-task-item:hover {
    background: rgba(255,255,255,0.07);
}

.aq-task-item.aq-task-done {
    background: rgba(34,197,94,0.08);
    border-color: rgba(34,197,94,0.2);
}

.aq-task-check {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.aq-task-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.aq-task-text {
    flex: 1;
    font-size: 0.9rem;
    color: #d1d5db;
}

.aq-task-done .aq-task-text {
    text-decoration: line-through;
    color: #6b7280;
}

.aq-task-btn {
    padding: 8px 18px;
    background: linear-gradient(135deg, #4CC9F0, #06b6d4);
    color: #000;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    flex-shrink: 0;
}

.aq-task-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(76,201,240,0.3);
}

/* ══ Claim Button ══ */
.aq-claim-btn {
    display: block;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #E63946, #dc2626);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.aq-claim-btn:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 6px 24px rgba(230,57,70,0.4);
}

.aq-claim-btn:disabled {
    background: #374151;
    color: #6b7280;
    cursor: not-allowed;
    transform: none;
}

.aq-claimed-info {
    text-align: center;
    padding: 12px;
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.2);
    border-radius: 10px;
}

.aq-claimed-info code {
    background: rgba(76,201,240,0.15);
    color: #4CC9F0;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.95rem;
}

.aq-goto-lixi {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #E63946, #dc2626);
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.15s;
}

.aq-goto-lixi:hover {
    transform: scale(1.05);
}

/* ══ Popups ══ */
.aq-popup {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aq-popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(6px);
}

.aq-popup-content {
    position: relative;
    background: linear-gradient(145deg, #111827, #1e293b);
    border: 1px solid rgba(76,201,240,0.2);
    border-radius: 16px;
    width: 90%;
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}

.aq-popup-small {
    max-width: 480px;
}

.aq-popup-scratch {
    max-width: 360px;
    text-align: center;
    padding: 24px;
    animation: aqScratchIn 0.4s ease;
    box-sizing: border-box;
    overflow: hidden;
}

@keyframes aqScratchIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.aq-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.aq-popup-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #fff;
}

.aq-popup-close-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #9ca3af;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.aq-popup-close-btn:hover:not(:disabled) {
    background: rgba(230,57,70,0.2);
    color: #E63946;
}

.aq-popup-close-btn:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

/* ══ Video Popup ══ */
#aq-video-container {
    background: #000;
    min-height: 360px;
}

#aq-video-container iframe {
    width: 100%;
    display: block;
}

.aq-video-progress {
    padding: 16px 24px;
}

.aq-video-progress-bar {
    height: 8px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.aq-video-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CC9F0, #22c55e);
    border-radius: 4px;
    transition: width 1s linear;
    width: 0%;
}

.aq-video-progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #9ca3af;
}

.aq-task-complete-btn {
    display: block;
    width: calc(100% - 48px);
    margin: 0 24px 20px;
    padding: 14px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s;
}

.aq-task-complete-btn:hover {
    transform: scale(1.02);
}

/* ══ Discord / Link / Question Popup Bodies ══ */
.aq-discord-body,
.aq-link-body,
.aq-question-body {
    padding: 24px;
    text-align: center;
}

.aq-discord-join-btn,
.aq-link-open-btn {
    display: inline-block;
    padding: 14px 32px;
    background: linear-gradient(135deg, #5865F2, #4752C4);
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    margin: 12px 0 20px;
    transition: transform 0.15s;
}

.aq-link-open-btn {
    background: linear-gradient(135deg, #4CC9F0, #06b6d4);
    color: #000 !important;
}

.aq-discord-join-btn:hover,
.aq-link-open-btn:hover {
    transform: scale(1.05);
}

.aq-discord-timer p,
.aq-link-timer p {
    color: #f59e0b;
    font-size: 1.1rem;
    font-weight: 600;
}

/* ══ Question ══ */
.aq-question-text {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 16px;
}

.aq-question-input {
    width: 100%;
    padding: 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    margin-bottom: 12px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.aq-question-input:focus {
    border-color: #4CC9F0;
}

.aq-question-error {
    color: #E63946;
    font-weight: 600;
}

/* ══ Scratch Card ══ */
.aq-scratch-title {
    color: #fff;
    font-size: 1.2rem;
    margin: 0 0 20px;
}

.aq-scratch-card {
    position: relative;
    display: block;
    margin: 0 auto 20px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(76,201,240,0.3);
    max-width: 300px;
    width: 100%;
}

.aq-scratch-code {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
    color: #4CC9F0;
    letter-spacing: 1px;
    background: #0f172a;
    font-family: 'Courier New', monospace;
    word-break: break-all;
    padding: 0 8px;
    box-sizing: border-box;
}

#aq-scratch-canvas {
    position: relative;
    z-index: 2;
    cursor: crosshair;
    touch-action: none;
    display: block;
    width: 100%;
    height: auto;
}

.aq-scratch-actions {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.aq-copy-btn {
    padding: 10px 24px;
    background: rgba(76,201,240,0.15);
    color: #4CC9F0;
    border: 1px solid rgba(76,201,240,0.3);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.aq-copy-btn:hover {
    background: rgba(76,201,240,0.25);
}

.aq-scratch-close-btn {
    margin-top: 12px;
    padding: 8px 20px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    color: #9ca3af;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

.aq-scratch-close-btn:hover {
    background: rgba(255,255,255,0.05);
}

/* ══ Responsive ══ */
@media (max-width: 640px) {
    .aq-main-title {
        font-size: 1.6rem;
    }

    .aq-quest-thumb {
        height: 140px;
    }

    .aq-quest-info {
        padding: 16px;
    }

    .aq-task-item {
        padding: 10px 12px;
        gap: 8px;
    }

    .aq-task-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .aq-popup-content {
        width: 95%;
        border-radius: 12px;
    }

    #aq-video-container {
        min-height: 200px;
    }
}
