/* Стили для системы квестов в стиле dropdown */

/* Окно квестов - аналог character-inner */
.quests-inner {
    width: 600px;
    display: flex;
    flex-direction: column;
}

.quests-header {
    flex-shrink: 0;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}

.quests-title {
    margin: 0;
    font-size: 1.05em;
    font-weight: 600;
    color: var(--color-accent-bright);
    letter-spacing: 0.5px;
}

/* Вкладки квестов - как у персонажа */
.quests-tabs {
    flex-shrink: 0;
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 0;
}

.quest-tab {
    flex: 1;
    padding: 10px 12px;
    font-size: 0.88em;
    font-weight: 500;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--color-text-dim);
    cursor: pointer;
    margin-bottom: -1px;
    transition: all 0.2s ease;
}

.quest-tab:hover { 
    color: var(--color-text);
    background: rgba(212, 165, 116, 0.08);
}

.quest-tab.active {
    color: var(--color-accent-bright);
    border-bottom-color: var(--color-accent);
    background: rgba(212, 165, 116, 0.12);
}

/* Контейнер контента квестов */
.quests-content {
    flex: 1;
    min-height: 0;
    height: 280px;
    overflow: hidden;
}

/* Панели вкладок */
.quest-tab-panel {
    display: none;
    height: 100%;
    overflow-y: auto;
    padding: 16px;
}

.quest-tab-panel.active {
    display: block;
}

.quest-tab-panel::-webkit-scrollbar {
    width: 8px;
}

.quest-tab-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.quest-tab-panel::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

.quest-tab-panel::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}

.quests-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.no-quests {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-text-dim);
    font-style: italic;
}

.quest-item {
    background: var(--color-panel);
    border: 2px solid var(--color-border);
    border-radius: 5px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quest-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Доступные квесты - серые */
.quest-available {
    border-color: var(--color-border-light);
    background: linear-gradient(to bottom, var(--color-panel-light) 0%, var(--color-panel) 100%);
}

.quest-available:hover {
    border-color: #8a7a68;
}

/* Активные квесты - зелёные */
.quest-active {
    border-color: #4a7c2c;
    background: linear-gradient(to bottom, #2d4a16 0%, #1e3010 100%);
}

.quest-active:hover {
    border-color: #5d9b3a;
}

/* Завершённые квесты - подсвеченные */
.quest-completed {
    border-color: #d4a574;
    background: linear-gradient(to bottom, #3a3227 0%, #2d271f 100%);
}

.quest-completed.can-claim {
    border-color: #ffd700;
    animation: pulse 2s infinite;
}

.quest-completed:hover {
    border-color: #e0b888;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 215, 0, 0.5); }
    50% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.8); }
}

.quest-name {
    font-size: 1.05em;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 5px;
}

.quest-type {
    font-size: 0.9em;
    color: var(--color-text-secondary);
}

.quest-progress {
    font-size: 0.9em;
    color: #a0d468;
    font-weight: 500;
}

.quest-status {
    font-size: 0.9em;
    color: #ffd700;
    font-weight: 600;
}

.no-quests {
    color: var(--color-text-secondary);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* ==================== ТУЛТИП КВЕСТА ==================== */
.quest-tooltip {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    background: linear-gradient(135deg, #2e2820 0%, #231e17 100%);
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    padding: 10px 14px;
    max-width: 280px;
    min-width: 180px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    animation: qtFadeIn 0.15s ease;
}

@keyframes qtFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.qt-name {
    font-size: 0.92em;
    font-weight: 600;
    color: var(--color-gold);
    margin-bottom: 4px;
    line-height: 1.3;
}

.qt-status {
    display: inline-block;
    font-size: 0.72em;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 3px;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.qt-available {
    background: rgba(100, 100, 120, 0.25);
    color: #9a9ab0;
}

.qt-active {
    background: rgba(76, 175, 80, 0.2);
    color: #81c784;
}

.qt-completed {
    background: rgba(255, 193, 7, 0.2);
    color: #ffd54f;
}

.qt-rewarded {
    background: rgba(136, 136, 136, 0.2);
    color: #aaa;
}

.qt-objective {
    font-size: 0.82em;
    color: var(--color-text);
    line-height: 1.45;
    padding: 5px 0 2px;
    border-top: 1px solid rgba(255,255,255,0.06);
    margin-top: 2px;
}

.qt-hint {
    font-size: 0.72em;
    color: var(--color-text-muted);
    font-style: italic;
    margin-top: 5px;
    padding-top: 4px;
    border-top: 1px dashed rgba(255,255,255,0.06);
}

/* Уведомления квестов */
.quest-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    background: var(--color-panel-light);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 5px;
    z-index: 10001;
    animation: questSlideIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    font-size: 0.9em;
    max-width: 400px;
}

.quest-notification-success {
    background: linear-gradient(135deg, #2d4a16, #1e3010);
    border-color: #4a7c2c;
    color: #c8e6c0;
}

.quest-notification-error {
    background: linear-gradient(135deg, #4a1616, #3a1010);
    border-color: #8b2020;
    color: #e6c0c0;
}

.quest-notification-info {
    background: linear-gradient(135deg, var(--color-panel-light), var(--color-panel));
    border-color: var(--color-border-light);
    color: var(--color-text);
}

.quest-notification-out {
    animation: questSlideOut 0.3s ease forwards;
}

@keyframes questSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes questSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ==================== GRID LAYOUT ДЛЯ КВЕСТОВ ==================== */

.quests-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
}

.quests-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(3, 95px);
    gap: 5px;
}

.quest-arrow-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 4px 0;
    flex-shrink: 0;
    margin-top: auto;
}

.quest-arrow {
    width: 36px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    line-height: 1;
    background: var(--color-panel-light);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.quest-arrow:hover:not(:disabled) {
    background: var(--color-panel-hover);
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.quest-arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.quest-page-num {
    min-width: 3em;
    font-size: 0.9em;
    color: var(--color-text-dim);
    text-align: center;
    font-weight: 500;
}

.quest-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 6px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.2));
    border: 2px solid var(--color-border);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 2px 8px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(0, 0, 0, 0.5);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    min-height: 100px;
    overflow: hidden;
}

/* Статусы квестов */
.quest-cell.available {
    opacity: 0.5;
    filter: grayscale(50%);
    background: rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.05);
}

.quest-cell.available:hover {
    opacity: 0.65;
}

.quest-cell.active {
    border-color: #4CAF50;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15), rgba(76, 175, 80, 0.08));
    box-shadow: 
        inset 0 1px 0 rgba(76, 175, 80, 0.2),
        0 0 20px rgba(76, 175, 80, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(76, 175, 80, 0.4);
    animation: questGlow 2s ease-in-out infinite;
}

.quest-cell.active:hover {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(76, 175, 80, 0.12));
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        inset 0 1px 0 rgba(76, 175, 80, 0.3),
        0 0 30px rgba(76, 175, 80, 0.4),
        0 6px 16px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(76, 175, 80, 0.5);
}

@keyframes questGlow {
    0%, 100% { box-shadow: inset 0 1px 0 rgba(76, 175, 80, 0.2), 0 0 20px rgba(76, 175, 80, 0.3), 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(76, 175, 80, 0.4); }
    50% { box-shadow: inset 0 1px 0 rgba(76, 175, 80, 0.3), 0 0 25px rgba(76, 175, 80, 0.4), 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(76, 175, 80, 0.5); }
}

.quest-cell.completed {
    border-color: var(--color-accent);
    background: linear-gradient(135deg, rgba(155, 44, 44, 0.15), rgba(155, 44, 44, 0.08));
    box-shadow: 
        inset 0 1px 0 rgba(155, 44, 44, 0.2),
        0 0 20px rgba(155, 44, 44, 0.25),
        0 4px 12px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(155, 44, 44, 0.3);
}

.quest-cell.completed:hover {
    background: linear-gradient(135deg, rgba(155, 44, 44, 0.2), rgba(155, 44, 44, 0.12));
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        inset 0 1px 0 rgba(155, 44, 44, 0.3),
        0 0 30px rgba(155, 44, 44, 0.35),
        0 6px 16px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(155, 44, 44, 0.4);
}

.quest-cell.rewarded {
    border-color: #888;
    background: rgba(136, 136, 136, 0.1);
    opacity: 0.7;
}

.quest-cell.rewarded:hover {
    opacity: 0.85;
}

.quest-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
    font-weight: bold;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.quest-cell.available .quest-icon {
    filter: grayscale(1);
    opacity: 0.4;
}

.quest-cell.active .quest-icon {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.3), rgba(76, 175, 80, 0.15));
    border-color: rgba(76, 175, 80, 0.4);
    box-shadow: 
        inset 0 1px 0 rgba(76, 175, 80, 0.3),
        0 0 12px rgba(76, 175, 80, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.3);
}

.quest-cell.completed .quest-icon {
    background: linear-gradient(135deg, rgba(155, 44, 44, 0.3), rgba(155, 44, 44, 0.15));
    border-color: rgba(155, 44, 44, 0.4);
    box-shadow: 
        inset 0 1px 0 rgba(155, 44, 44, 0.3),
        0 0 12px rgba(155, 44, 44, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.3);
}

.quest-name-cell {
    font-size: 0.68em;
    color: var(--color-text-muted);
    text-align: center;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    word-break: break-word;
    max-width: 100%;
    padding: 0 2px;
}

.quest-cell.active .quest-name-cell {
    color: var(--color-text-dim);
}

.quest-cell.completed .quest-name-cell {
    color: var(--color-text-dim);
}

/* Прогресс бар в ячейке квеста */
.quest-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 2px;
}

.quest-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #66BB6A);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.quest-cell.completed .quest-progress-fill {
    background: linear-gradient(90deg, var(--color-accent), #E6C89C);
}

/* Индикатор статуса */
.quest-status-badge-cell {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-weight: bold;
}

.quest-cell.active .quest-status-badge-cell {
    background: rgba(76, 175, 80, 0.8);
}

.quest-cell.completed .quest-status-badge-cell {
    background: rgba(212, 165, 116, 0.8);
}

.quest-cell.rewarded .quest-status-badge-cell {
    background: rgba(136, 136, 136, 0.8);
}

.quest-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9em;
    padding: 20px;
}

/* Иконки по типу квеста */
.quest-icon-kill { background: linear-gradient(135deg, #8B0000, #A52A2A); }
.quest-icon-collect { background: linear-gradient(135deg, #2F4F4F, #3B5F5F); }
.quest-icon-visit { background: linear-gradient(135deg, #483D8B, #5A4FA8); }
.quest-icon-talk { background: linear-gradient(135deg, #4682B4, #5B9BD5); }
.quest-icon-default { background: linear-gradient(135deg, #696969, #808080); }
