/**
 * D&D AI RPG - Crafting System Styles
 * Crafting UI, recipes, and notifications
 */

/* Crafting Panel */
.crafting-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; }
}

.crafting-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #e67e22;
    border-radius: 15px;
    max-width: 800px;
    width: 95%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.crafting-header {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.crafting-header h2 {
    margin: 0;
    color: white;
    font-size: 20px;
}

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

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

/* Skill Badges */
.crafting-skills {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(230, 126, 34, 0.3);
    overflow-x: auto;
}

.skill-badge {
    background: rgba(230, 126, 34, 0.2);
    border: 1px solid rgba(230, 126, 34, 0.5);
    border-radius: 20px;
    padding: 6px 12px;
    display: flex;
    gap: 8px;
    align-items: center;
    white-space: nowrap;
}

.skill-name {
    font-size: 12px;
    color: #ecf0f1;
    text-transform: capitalize;
}

.skill-level {
    font-size: 11px;
    color: #e67e22;
    font-weight: bold;
}

/* Tabs */
.crafting-tabs {
    display: flex;
    gap: 5px;
    padding: 10px 15px 0;
    background: rgba(0, 0, 0, 0.2);
    overflow-x: auto;
}

.crafting-tab {
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 8px 8px 0 0;
    color: #95a5a6;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    font-size: 13px;
}

.crafting-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ecf0f1;
}

.crafting-tab.active {
    background: rgba(230, 126, 34, 0.2);
    color: #e67e22;
    border-bottom: 2px solid #e67e22;
}

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

.crafting-category {
    display: none;
}

.crafting-category.active {
    display: block;
}

.no-recipes {
    text-align: center;
    color: #7f8c8d;
    padding: 40px;
    font-style: italic;
}

/* Recipe Grid */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.recipe-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.recipe-card:hover {
    background: rgba(230, 126, 34, 0.1);
    border-color: rgba(230, 126, 34, 0.3);
    transform: translateY(-2px);
}

.recipe-card.craftable {
    border-color: rgba(46, 204, 113, 0.5);
}

.recipe-card.locked {
    opacity: 0.6;
}

.recipe-icon {
    font-size: 32px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    flex-shrink: 0;
}

.recipe-info {
    flex: 1;
    min-width: 0;
}

.recipe-name {
    font-size: 14px;
    font-weight: bold;
    color: #ecf0f1;
    margin-bottom: 4px;
}

.recipe-desc {
    font-size: 11px;
    color: #7f8c8d;
    margin-bottom: 6px;
}

.recipe-skill {
    font-size: 10px;
    color: #e67e22;
    text-transform: capitalize;
}

.recipe-skill.insufficient {
    color: #e74c3c;
}

.recipe-craftable {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #2ecc71;
    font-weight: bold;
}

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

.recipe-detail-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #e67e22;
    border-radius: 15px;
    max-width: 450px;
    width: 90%;
    padding: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.recipe-detail-header {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 13px 13px 0 0;
}

.recipe-detail-icon {
    font-size: 28px;
}

.recipe-detail-header h3 {
    margin: 0;
    color: white;
    font-size: 18px;
    flex: 1;
}

.recipe-detail-header .close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 16px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.recipe-detail-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.recipe-detail-desc {
    padding: 15px 20px;
    margin: 0;
    color: #bdc3c7;
    font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.recipe-materials,
.recipe-result {
    padding: 15px 20px;
}

.recipe-materials h4,
.recipe-result h4 {
    margin: 0 0 12px 0;
    color: #e67e22;
    font-size: 14px;
}

.material-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    margin-bottom: 6px;
}

.material-row.sufficient .material-count {
    color: #2ecc71;
}

.material-row.insufficient .material-count {
    color: #e74c3c;
}

.material-name {
    color: #ecf0f1;
    font-size: 13px;
}

.material-count {
    font-weight: bold;
    font-size: 13px;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.result-icon {
    font-size: 24px;
}

.result-name {
    flex: 1;
    color: #ecf0f1;
    font-size: 14px;
}

.result-rarity {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: capitalize;
}

.result-rarity.rarity-common { background: rgba(149, 165, 166, 0.3); color: #95a5a6; }
.result-rarity.rarity-uncommon { background: rgba(46, 204, 113, 0.3); color: #2ecc71; }
.result-rarity.rarity-rare { background: rgba(52, 152, 219, 0.3); color: #3498db; }
.result-rarity.rarity-epic { background: rgba(155, 89, 182, 0.3); color: #9b59b6; }
.result-rarity.rarity-legendary { background: rgba(241, 196, 15, 0.3); color: #f1c40f; }

.recipe-actions {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0 0 13px 13px;
}

.craft-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.craft-btn:hover:not(.disabled) {
    background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%);
    transform: translateY(-1px);
}

.craft-btn.disabled {
    background: rgba(127, 140, 141, 0.3);
    color: #95a5a6;
    cursor: not-allowed;
}

/* Crafting Notification */
.crafting-notification {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #e67e22;
    border-radius: 10px;
    padding: 12px 20px;
    color: white;
    z-index: 5000;
    animation: slideDown 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

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

.crafting-notification .notif-icon {
    font-size: 20px;
}

.crafting-notification .notif-text {
    font-size: 14px;
}

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

    .recipe-grid {
        grid-template-columns: 1fr;
    }

    .crafting-skills {
        flex-wrap: wrap;
    }

    .crafting-tabs {
        gap: 3px;
    }

    .crafting-tab {
        padding: 8px 10px;
        font-size: 11px;
    }
}
