/* ============================================
   MODERN QUEST SYSTEM - НЕЗАВИСИМЫЕ СТИЛИ
   Полностью отдельная система от riddle-menu.css
   ============================================ */

/* Reset */
.quest-modern-wrapper * {
    box-sizing: border-box;
}

/* Overlay - полноэкранный фон */
.quest-modern-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, rgba(10, 15, 25, 0.98) 0%, rgba(15, 25, 35, 0.98) 100%);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: questModernFadeIn 0.3s ease;
}

/* Главный контейнер */
.quest-modern-container {
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    background: linear-gradient(135deg, rgba(20, 30, 50, 0.95) 0%, rgba(15, 25, 40, 0.95) 100%);
    border: 2px solid rgba(0, 255, 136, 0.4);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 60px rgba(0, 255, 136, 0.1);
    overflow: hidden;
    position: relative;
    animation: questModernSlideIn 0.4s ease;
}

.quest-modern-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(0, 255, 136, 0.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Header */
.quest-modern-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid rgba(0, 255, 136, 0.3);
    position: relative;
    z-index: 1;
}

.quest-modern-header h1 {
    color: #00ff88;
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Close button */
.quest-modern-close {
    background: rgba(255, 107, 107, 0.2);
    border: 2px solid #ff6b6b;
    color: #ff6b6b;
    font-size: 24px;
    font-weight: 700;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.quest-modern-close:hover {
    background: rgba(255, 107, 107, 0.4);
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
    transform: scale(1.1);
}

/* Content area */
.quest-modern-content {
    padding: 30px;
    position: relative;
    z-index: 1;
    max-height: calc(90vh - 120px);
    overflow-y: auto;
}

/* Текст квеста */
.quest-modern-text {
    background: rgba(0, 0, 0, 0.2);
    border-left: 4px solid #00ff88;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.quest-modern-text p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
}

/* Поле ввода */
.quest-modern-input-area {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.quest-modern-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 12px;
    padding: 15px 20px;
    color: #333;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    outline: none;
}

.quest-modern-input:focus {
    border-color: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
    background: rgba(255, 255, 255, 1);
}

.quest-modern-input.hidden {
    display: none;
}

.quest-modern-input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

/* Submit button */
.quest-modern-submit {
    background: linear-gradient(135deg, #00cc70 0%, #00ff88 100%);
    border: 2px solid #00ff88;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 15px 30px;
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3);
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quest-modern-submit:hover {
    background: linear-gradient(135deg, #00ff88 0%, #00ffaa 100%);
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.5);
    transform: translateY(-2px);
}

.quest-modern-submit.hidden {
    display: none;
}

/* Controls */
.quest-modern-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Hint button */
.quest-modern-hint-btn {
    flex: 1;
    min-width: 200px;
    padding: 15px 25px;
    background: linear-gradient(135deg, rgba(243, 183, 1, 0.9) 0%, rgba(200, 160, 80, 0.95) 100%);
    border: 2px solid rgba(243, 183, 1, 0.8);
    border-radius: 12px;
    color: #2a2a2a;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(243, 183, 1, 0.3);
}

.quest-modern-hint-btn:hover {
    background: linear-gradient(135deg, rgba(243, 183, 1, 1) 0%, rgba(220, 180, 100, 1) 100%);
    box-shadow: 0 6px 20px rgba(243, 183, 1, 0.5);
    transform: translateY(-2px);
}

.quest-modern-hint-btn.hidden {
    display: none;
}

.quest-modern-hint-btn .hint-count {
    font-weight: 700;
    color: #1a1a1a;
}

/* Buy button */
.quest-modern-buy-btn {
    flex: 1;
    min-width: 200px;
    padding: 15px 25px;
    background: linear-gradient(135deg, #00cc70 0%, #00ff88 100%);
    border: 2px solid #00ff88;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3);
}

.quest-modern-buy-btn:hover {
    background: linear-gradient(135deg, #00ff88 0%, #00ffaa 100%);
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.5);
    transform: translateY(-2px);
}

.quest-modern-buy-btn.hidden {
    display: none;
}

/* Hint display */
.quest-modern-hint-display {
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    animation: questModernHintSlide 0.3s ease;
}

.quest-modern-hint-display.hidden {
    display: none;
}

.quest-modern-hint-display.quest-hint {
    background: rgba(243, 183, 1, 0.15);
    border: 2px solid rgba(243, 183, 1, 0.4);
}

.quest-modern-hint-display.quest-success {
    background: rgba(0, 255, 136, 0.15);
    border: 2px solid rgba(0, 255, 136, 0.4);
}

.quest-modern-hint-display.quest-error {
    background: rgba(255, 107, 107, 0.15);
    border: 2px solid rgba(255, 107, 107, 0.4);
}

.quest-modern-hint-display .hint-content {
    font-size: 16px;
    line-height: 1.6;
    text-align: center;
    font-weight: 500;
}

.quest-modern-hint-display.quest-hint .hint-content {
    color: rgba(243, 183, 1, 0.95);
}

.quest-modern-hint-display.quest-success .hint-content {
    color: rgba(0, 255, 136, 0.95);
}

.quest-modern-hint-display.quest-error .hint-content {
    color: rgba(255, 107, 107, 0.95);
}

/* Shop */
.quest-modern-shop {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    animation: questModernHintSlide 0.3s ease;
}

.quest-modern-shop.hidden {
    display: none;
}

.quest-modern-discount {
    color: #00ff88;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.quest-modern-shop-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.quest-modern-shop-item {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1) 0%, rgba(0, 200, 100, 0.1) 100%);
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
}

.quest-modern-shop-item:hover {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2) 0%, rgba(0, 200, 100, 0.2) 100%);
    border-color: #00ff88;
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3);
    transform: translateY(-2px);
}

.quest-modern-shop-item img {
    width: 50px;
    height: 50px;
    margin-bottom: 10px;
}

.shop-item-amount {
    font-size: 32px;
    font-weight: 700;
    color: #00ff88;
    margin-bottom: 5px;
}

.shop-item-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
}

.shop-item-price {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 12px;
    border-radius: 8px;
    display: inline-block;
}

/* Info */
.quest-modern-info {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-style: italic;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

/* Success animation */
.quest-modern-container.quest-completed {
    animation: questModernSuccess 1s ease;
}

/* Shake animation for wrong answer */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

.quest-modern-input.shake {
    animation: shake 0.5s ease;
}

/* Scrollbar */
.quest-modern-content::-webkit-scrollbar {
    width: 8px;
}

.quest-modern-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.quest-modern-content::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 136, 0.3);
    border-radius: 4px;
}

.quest-modern-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 136, 0.5);
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

@keyframes questModernSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes questModernHintSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes questModernSuccess {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 30px rgba(0, 255, 136, 0.8);
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

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

@media (max-width: 768px) {
    .quest-modern-container {
        width: 95%;
        max-height: 95vh;
    }
    
    .quest-modern-header {
        padding: 20px;
    }
    
    .quest-modern-header h1 {
        font-size: 22px;
    }
    
    .quest-modern-close {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .quest-modern-content {
        padding: 20px;
    }
    
    .quest-modern-input-area {
        flex-direction: column;
    }
    
    .quest-modern-controls {
        flex-direction: column;
    }
    
    .quest-modern-hint-btn,
    .quest-modern-buy-btn {
        min-width: auto;
    }
    
    .quest-modern-shop-items {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .quest-modern-header h1 {
        font-size: 18px;
    }
    
    .quest-modern-content {
        padding: 15px;
    }
    
    .quest-modern-input,
    .quest-modern-submit {
        font-size: 14px;
        padding: 12px 15px;
    }
    
    .quest-modern-hint-btn,
    .quest-modern-buy-btn {
        font-size: 14px;
        padding: 12px 20px;
    }
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */

@media (prefers-color-scheme: dark) {
    .quest-modern-overlay {
        background: linear-gradient(135deg, rgba(5, 10, 15, 0.98) 0%, rgba(10, 15, 25, 0.98) 100%);
    }
    
    .quest-modern-container {
        background: linear-gradient(135deg, rgba(15, 25, 40, 0.98) 0%, rgba(10, 20, 35, 0.98) 100%);
    }
}
