/**
 * D&D AI RPG - Enchanting System Styles
 * Magical item enhancement UI
 */

/* Enchanting Panel Overlay */
.enchanting-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 3500;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

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

.enchanting-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #9b59b6;
    border-radius: 15px;
    max-width: 900px;
    width: 95%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(155, 89, 182, 0.3);
}

/* Header */
.enchanting-header {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.header-icon {
    font-size: 32px;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px;
    border-radius: 10px;
}

.header-title h2 {
    margin: 0;
    color: #fff;
    font-size: 20px;
}

.header-title p {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.gold-display {
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    color: #f1c40f;
}

.enchanting-header .close-btn {
    background: rgba(0, 0, 0, 0.2);
    border: none;
    color: #fff;
    font-size: 18px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.enchanting-header .close-btn:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: rotate(90deg);
}

/* Body */
.enchanting-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(85vh - 80px);
}

.enchanting-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Panels */
.items-panel,
.enchantments-panel {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
}

.items-panel h3,
.enchantments-panel h3 {
    margin: 0 0 15px 0;
    color: #9b59b6;
    font-size: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(155, 89, 182, 0.3);
}

/* Enchantable Items */
.enchantable-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.enchantable-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.enchantable-item:hover {
    border-color: rgba(155, 89, 182, 0.5);
    background: rgba(155, 89, 182, 0.1);
}

.enchantable-item.selected {
    border-color: #9b59b6;
    background: rgba(155, 89, 182, 0.2);
    box-shadow: 0 0 10px rgba(155, 89, 182, 0.3);
}

.enchantable-item .item-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.enchantable-item .item-info {
    flex: 1;
}

.enchantable-item .item-name {
    font-weight: bold;
    font-size: 13px;
}

.enchantable-item .item-name.common { color: #ecf0f1; }
.enchantable-item .item-name.uncommon { color: #2ecc71; }
.enchantable-item .item-name.rare { color: #3498db; }
.enchantable-item .item-name.epic { color: #9b59b6; }
.enchantable-item .item-name.legendary { color: #f39c12; }

.enchantable-item .item-type {
    font-size: 11px;
    color: #7f8c8d;
}

.enchantable-item .enchant-count {
    font-size: 10px;
    color: #9b59b6;
    margin-top: 2px;
}

/* No Items */
.no-items,
.no-enchants,
.select-item-prompt {
    text-align: center;
    padding: 30px;
    color: #7f8c8d;
    font-style: italic;
}

/* Enchantment Options */
.enchantment-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.enchantment-option {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px;
    transition: all 0.3s;
}

.enchantment-option:hover:not(.unavailable) {
    border-color: rgba(155, 89, 182, 0.5);
}

.enchantment-option.unavailable {
    opacity: 0.5;
}

.enchant-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.enchant-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    background: rgba(155, 89, 182, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.enchant-info {
    flex: 1;
}

.enchant-name {
    font-weight: bold;
    color: #ecf0f1;
    font-size: 14px;
}

.enchant-desc {
    font-size: 12px;
    color: #95a5a6;
}

.enchant-cost {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.materials {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.material {
    font-size: 11px;
    color: #3498db;
    background: rgba(52, 152, 219, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
}

.gold-cost {
    font-weight: bold;
    color: #f1c40f;
    font-size: 13px;
}

.enchant-reason {
    font-size: 11px;
    color: #e74c3c;
    margin-bottom: 8px;
    text-align: center;
}

.enchant-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.enchant-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.4);
}

.enchant-btn:disabled {
    background: #555;
    cursor: not-allowed;
}

/* Notification */
.enchanting-notification {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.95) 0%, rgba(142, 68, 173, 0.95) 100%);
    border: 3px solid #9b59b6;
    border-radius: 12px;
    padding: 15px 25px;
    color: #fff;
    z-index: 5000;
    animation: enchantNotify 0.5s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(155, 89, 182, 0.4);
    font-weight: 500;
}

@keyframes enchantNotify {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.8) translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) scale(1) translateY(0);
    }
}

.enchanting-notification.fade-out {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
    transition: all 0.5s ease;
}

.enchanting-notification span {
    font-size: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .enchanting-content {
        max-width: 98%;
    }

    .enchanting-layout {
        grid-template-columns: 1fr;
    }

    .enchantable-items,
    .enchantment-options {
        max-height: 250px;
    }
}
