/* trader.css - Обновленные стили для страницы торговца */

.trader-header {
    background: linear-gradient(135deg, rgba(74, 124, 89, 0.9) 0%, rgba(58, 101, 72, 0.9) 100%), 
                url('../assets/images/medieval-market.jpg') center/cover no-repeat;
    padding: 120px 0;
    text-align: center;
    color: var(--text-light);
    margin-bottom: 50px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    border-bottom: 3px solid var(--accent-color);
}

.trader-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../assets/pattern-leaves.png') repeat;
    opacity: 0.1;
    pointer-events: none;
}

.trader-header h1 {
    font-size: 3.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    position: relative;
    margin-bottom: 20px;
}

.trader-header p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    opacity: 0.9;
}

.trader-controls {
    background: linear-gradient(145deg, #f8f4e3, #ffffff);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: 2px solid var(--accent-color);
    position: relative;
    overflow: hidden;
}

.trader-controls::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color), var(--primary-light));
}

.trader-results {
    background: linear-gradient(145deg, #f8f4e3, #ffffff);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: 2px solid var(--accent-color);
}

.item-category {
    margin-bottom: 30px;
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.item-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(74, 124, 89, 0.2);
}

.category-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 12px 20px;
    font-weight: bold;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-header i {
    font-size: 1.4rem;
    color: var(--accent-color);
}

.item-table {
    width: 100%;
    border-collapse: collapse;
}

.item-table th {
    background-color: rgba(212, 180, 131, 0.2);
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--accent-color);
    color: var(--primary-dark);
}

.item-table td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(212, 180, 131, 0.3);
    vertical-align: middle;
}

.item-table tr:last-child td {
    border-bottom: none;
}

.item-table tr:hover {
    background-color: rgba(212, 180, 131, 0.1);
    cursor: pointer;
}

.rarity-common { color: #616161; }
.rarity-uncommon { color: #2e7d32; font-weight: 500; }
.rarity-rare { color: #1565c0; font-weight: 500; }
.rarity-very-rare { color: #6a1b9a; font-weight: 600; }
.rarity-legendary { color: #e65100; font-weight: 600; }

.item-quantity {
    color: var(--primary-dark);
    font-size: 0.85em;
    background: rgba(212, 180, 131, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 5px;
    font-weight: 600;
}

.item-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
}

.modal-content {
    background: linear-gradient(145deg, #f8f4e3, #ffffff);
    padding: 25px;
    border-radius: 12px;
    max-width: 650px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border-top: 5px solid var(--primary-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    position: relative;
    border: 2px solid var(--accent-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed var(--accent-color);
}

.modal-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-dark);
    font-family: 'MedievalSharp', cursive;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--primary-dark);
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--accent-color);
}

.item-rarity {
    font-size: 1.1rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-dark);
}

.item-price {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--primary-dark);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.item-price::before {
    content: "💰";
}

.item-description {
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 20px;
    white-space: pre-line;
    color: var(--text-dark);
}

.source-info {
    font-style: italic;
    color: var(--primary-dark);
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed var(--accent-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.source-info::before {
    content: "📖";
}

.empty-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--primary-dark);
    font-style: italic;
    font-size: 1.1rem;
    opacity: 0.7;
}

.btn-trader {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 12px 30px;
    transition: all 0.3s;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(74, 124, 89, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-trader:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(74, 124, 89, 0.4);
}

.btn-trader::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s;
    z-index: -1;
}

.btn-trader:hover::before {
    transform: translateX(100%);
}

.form-control, .form-select {
    border: 1px solid var(--accent-color);
    border-radius: 6px;
    padding: 10px 15px;
    transition: all 0.3s;
    background-color: rgba(255,255,255,0.8);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(138, 167, 108, 0.3);
}

.form-label {
    font-weight: 500;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.charisma-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(212, 180, 131, 0.3);
    outline: none;
}

.charisma-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid var(--accent-color);
}

.charisma-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    background: var(--primary-dark);
}

.charisma-value {
    font-weight: bold;
    color: var(--primary-dark);
    font-size: 1.1rem;
}

.rarity-badge {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 6px;
    border: 1px solid rgba(0,0,0,0.1);
}

.rarity-badge.common { background-color: #616161; }
.rarity-badge.uncommon { background-color: #2e7d32; }
.rarity-badge.rare { background-color: #1565c0; }
.rarity-badge.very-rare { background-color: #6a1b9a; }
.rarity-badge.legendary { background-color: #e65100; }

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Адаптивность */
@media (max-width: 768px) {
    .trader-header {
        padding: 80px 0;
    }
    
    .trader-header h1 {
        font-size: 2.5rem;
    }
    
    .trader-controls {
        padding: 20px;
    }
    
    .modal-title {
        font-size: 1.4rem;
    }
    
    .category-header {
        font-size: 1.1rem;
        padding: 10px 15px;
    }
    
    .btn-trader {
        width: 100%;
    }
}