/**
 * QUESTS DATABASE STYLES - REFINED (Matching Arcs Style)
 */

.quests-db-wrapper {
    background: var(--item-bg-dark, #0a0a0a);
    min-height: 100vh;
    padding-bottom: 80px;
}

/* Hero Section */
.quests-db-wrapper .items-hero-section {
    position: relative;
    z-index: 10;
}

/* Grid Layout */
.quests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
    position: relative;
}

.quest-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.quest-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-primary, #ff6b35);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.quest-image-container {
    height: 200px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.quest-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.quest-trader-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 107, 53, 0.9);
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    z-index: 5;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.quest-placeholder {
    font-size: 3rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.1);
}

.quest-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
}

.quest-name {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.quest-details-btn {
    background: rgba(255, 107, 53, 0.1);
    border: 1px solid rgba(255, 107, 53, 0.2);
    color: var(--accent-primary, #ff6b35);
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    margin-top: auto;
    width: 100%;
}

.quest-card:hover .quest-details-btn {
    background: var(--accent-primary, #ff6b35);
    color: #fff;
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.3);
    border-color: var(--accent-primary, #ff6b35);
}

/* MODAL STYLES (Matching Arcs) */
.quest-modal .modal-dialog {
    max-width: 600px;
    background: #1a1a1a;
    color: #fff;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
}

.quest-modal-header {
    height: 250px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
}

.quest-modal-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 60%, rgba(0, 0, 0, 0) 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 60%, rgba(0, 0, 0, 0) 100%);
}

.quest-modal-overlay-content {
    position: absolute;
    bottom: 30px;
    left: 30px;
    right: 30px;
    z-index: 2;
}

.quest-modal-title {
    font-size: 2.2rem;
    font-weight: 950;
    text-transform: uppercase;
    margin: 0;
    color: #ff6b35;
    line-height: 1.1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.quest-modal-content {
    padding: 30px;
}

/* Sections Styling */
.quest-section-title {
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    margin: 25px 0 15px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.quest-section-title i {
    color: #ff6b35;
    width: 20px;
    text-align: center;
}

/* Objectives Styling from Image */
.quest-objective-item {
    background: rgba(255, 255, 255, 0.03);
    border-left: 4px solid #ff6b35;
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 12px;
    color: #eee;
    font-weight: 500;
    line-height: 1.5;
    position: relative;
}

/* Loot Grid (Reusing Arcs Classes for Consistency) */
.quest-loot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

/* Ensure these classes match arcs.css exactly */
.quest-modal .loot-item-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    height: auto;
    /* Fix for potential stretching */
}

.quest-modal .loot-item-icon {
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.quest-modal .loot-item-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.quest-modal .loot-item-name {
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    color: #ddd;
}

/* Rarity colors for Quests Modal */
.quest-modal .loot-item-card.rarity-uncommon .loot-item-icon {
    border-color: rgba(46, 204, 113, 0.4);
}

.quest-modal .loot-item-card.rarity-rare .loot-item-icon {
    border-color: rgba(52, 152, 219, 0.4);
}

.quest-modal .loot-item-card.rarity-epic .loot-item-icon {
    border-color: rgba(155, 89, 182, 0.4);
}

.quest-modal .loot-item-card.rarity-legendary .loot-item-icon {
    border-color: rgba(241, 196, 15, 0.4);
}

.quest-modal .loot-item-card.rarity-uncommon .loot-item-name {
    color: #2ecc71;
}

.quest-modal .loot-item-card.rarity-rare .loot-item-name {
    color: #3498db;
}

.quest-modal .loot-item-card.rarity-epic .loot-item-name {
    color: #9b59b6;
}

.quest-modal .loot-item-card.rarity-legendary .loot-item-name {
    color: #f1c40f;
}

@media (max-width: 768px) {
    .quest-modal .modal-dialog {
        max-width: 94%;
        margin: 20px auto;
        border-radius: 16px;
        max-height: 85vh;
        min-height: auto;
    }

    .quest-modal-header {
        height: 180px;
    }

    .quest-modal-title {
        font-size: 1.6rem;
    }

    .quest-modal-overlay-content {
        bottom: 20px;
        left: 20px;
        right: 20px;
    }

    .quest-loot-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }

    .quest-modal .quest-modal-content {
        padding: 20px;
    }

    .quest-modal .modal-x {
        top: 10px;
        right: 10px;
        background: rgba(0, 0, 0, 0.7) !important;
        border: 1px solid rgba(255, 255, 255, 0.3) !important;
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
        z-index: 110;
    }
}