/* Crafting and shops UI - extracted from inline index.html */

/* Transcendence Weapon Glow Animations */
@keyframes transcend-glow-1 {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.4), 0 0 20px rgba(255, 215, 0, 0.2); }
    50% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), 0 0 30px rgba(255, 215, 0, 0.3); }
}

@keyframes transcend-glow-2 {
    0%, 100% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.5), 0 0 30px rgba(255, 215, 0, 0.3); }
    50% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.8), 0 0 45px rgba(255, 215, 0, 0.4); }
}

@keyframes transcend-glow-3 {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), 0 0 40px rgba(255, 215, 0, 0.3), 0 0 60px rgba(255, 215, 0, 0.1); }
    50% { box-shadow: 0 0 40px rgba(255, 215, 0, 1), 0 0 60px rgba(255, 215, 0, 0.5), 0 0 80px rgba(255, 215, 0, 0.2); }
}

/* ===== CRAFTING SYSTEM STYLES ===== */
.crafting-modal {
    color: #fff;
    padding: 15px;
}

.crafting-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.crafting-resources {
    display: flex;
    gap: 20px;
}

.crafting-resources span {
    font-size: 1.1em;
}

.crafting-income {
    display: flex;
    align-items: center;
    gap: 10px;
}

.crafting-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.crafting-tabs .tab {
    padding: 10px 20px;
    background: rgba(30, 30, 50, 0.8);
    border: 2px solid #4ecdc4;
    color: #4ecdc4;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.crafting-tabs .tab:hover {
    background: rgba(78, 205, 196, 0.2);
}

.crafting-tabs .tab.active {
    background: linear-gradient(135deg, #4ecdc4, #45b7aa);
    color: #fff;
}

.workshops-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.workshop-card {
    padding: 15px;
    background: rgba(30, 30, 50, 0.8);
    border: 2px solid;
    border-radius: 12px;
}

.workshop-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.workshop-icon {
    font-size: 1.5em;
}

.workshop-name {
    font-size: 1.2em;
    font-weight: bold;
}

.workshop-workers {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.workshop-disciples {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    min-height: 50px;
}

.worker-badge {
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid;
    border-radius: 6px;
    font-size: 0.9em;
}

.worker-badge .worker-name {
    font-weight: bold;
}

.worker-badge .worker-stats {
    display: flex;
    gap: 8px;
    font-size: 0.85em;
    color: #aaa;
}

.no-workers {
    color: #888;
    font-style: italic;
    width: 100%;
    text-align: center;
    padding: 10px;
}

.workshop-stats {
    display: flex;
    justify-content: space-between;
    color: #aaa;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.workshop-resources {
    color: #aaa;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.workshop-resources .warning {
    color: #ff6b6b;
    margin-left: 10px;
}

.progress-bar {
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s;
}

.shopkeeper-section {
    padding: 15px;
    background: rgba(30, 30, 50, 0.8);
    border: 2px solid #ffd700;
    border-radius: 12px;
}

.shopkeeper-section h3 {
    color: #ffd700;
    margin-bottom: 10px;
}

.shopkeeper-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid;
    border-radius: 8px;
}

.shopkeeper-name {
    font-weight: bold;
    font-size: 1.1em;
}

.shopkeeper-stats {
    display: flex;
    gap: 15px;
    color: #aaa;
}

.no-shopkeeper {
    text-align: center;
    padding: 15px;
    color: #aaa;
}

/* Shop Items */
.shop-items {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    max-height: calc(85vh - 200px);
    overflow-y: auto;
}

.shop-item {
    padding: 12px;
    background: rgba(30, 30, 50, 0.8);
    border: 2px solid;
    border-radius: 10px;
    text-align: center;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.shop-item .item-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.shop-item .item-icon {
    font-size: 1.5em;
}

.shop-item .item-rarity {
    font-weight: bold;
    margin-bottom: 8px;
}

.shop-item .item-stats {
    display: flex;
    justify-content: center;
    gap: 10px;
    font-size: 0.85em;
    color: #aaa;
    margin-bottom: 8px;
}

.shop-item .item-price {
    font-size: 1.1em;
    margin-bottom: 10px;
}

.shop-empty {
    text-align: center;
    padding: 40px;
    color: #888;
}

/* Assignment View */
.assignment-view {
    padding: 10px;
}

.assignment-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.assignment-header h3 {
    margin: 0;
}

.assignment-current, .assignment-available {
    margin-bottom: 20px;
}

.assignment-current h4, .assignment-available h4 {
    color: #4ecdc4;
    margin-bottom: 10px;
}

.workers-list, .available-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
}

.worker-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid;
    border-radius: 8px;
}

.worker-row .worker-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.worker-row .worker-name {
    font-weight: bold;
}

.worker-row .worker-rank {
    color: #aaa;
}

/* Crafting Buttons */
.btn-assign, .btn-collect, .btn-buy, .btn-back, .btn-remove {
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
}

.btn-assign {
    background: linear-gradient(135deg, #4ecdc4, #45b7aa);
    color: #fff;
}

.btn-assign:hover {
    background: linear-gradient(135deg, #5fd4cc, #4ecdc4);
}

.btn-collect {
    background: linear-gradient(135deg, #ffd700, #ffb347);
    color: #1a1a2e;
    font-weight: bold;
}

.btn-collect:hover {
    background: linear-gradient(135deg, #ffe44d, #ffc966);
}

.btn-buy {
    background: linear-gradient(135deg, #4ecdc4, #45b7aa);
    color: #fff;
}

.btn-buy:hover {
    background: linear-gradient(135deg, #5fd4cc, #4ecdc4);
}

.btn-buy.disabled {
    background: #444;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-back {
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
    border: 1px solid #aaa;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.btn-remove {
    background: linear-gradient(135deg, #ff6b6b, #ff4444);
    color: #fff;
}

.btn-remove:hover {
    background: linear-gradient(135deg, #ff7b7b, #ff5555);
}

/* Crafting Modal Footer */
.crafting-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
}

.btn-close-modal, .btn-back-modal {
    padding: 12px 40px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1em;
}

.btn-close-modal {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
}

.btn-close-modal:hover {
    background: linear-gradient(135deg, #ff5f4f, #d63c2b);
}

.btn-back-modal {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
}

.btn-back-modal:hover {
    background: linear-gradient(135deg, #ff5f4f, #d63c2b);
}

/* Sell Resources View */
.sell-resources-container {
    padding: 20px;
}

.sell-resources-container h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #f0f0f0;
}

.sell-resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.sell-resource-card {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
}

.sell-resource-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sell-resource-icon {
    font-size: 2em;
}

.sell-resource-name {
    font-size: 1.3em;
    font-weight: bold;
    color: #f0f0f0;
}

.sell-resource-info {
    margin-bottom: 15px;
}

.sell-resource-available,
.sell-resource-price,
.sell-resource-total {
    padding: 5px 0;
    color: #ccc;
}

.sell-resource-total {
    font-weight: bold;
    color: #ffd700;
}

.sell-resource-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sell-amount-input {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 1em;
}

.sell-buttons {
    display: flex;
    gap: 8px;
}

.btn-sell-preset {
    flex: 1;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-sell-preset:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-sell {
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-sell:hover:not(:disabled) {
    background: linear-gradient(135deg, #2dd269, #1eb855);
}

.btn-sell:disabled {
    background: rgba(100, 100, 100, 0.5);
    cursor: not-allowed;
}

/* Subtalent & Skill Display (Disciple Details) */
.subtalent-skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.subtalent-skill-box {
    padding: 15px;
    background: rgba(30, 30, 50, 0.8);
    border: 2px solid;
    border-radius: 10px;
}

.subtalent-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.subtalent-icon {
    font-size: 1.4em;
}

.subtalent-name {
    font-weight: bold;
    font-size: 1.1em;
}

.subtalent-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.subtalent-label {
    color: #aaa;
}

.subtalent-value {
    font-weight: bold;
}

.subtalent-bonus {
    color: #22c55e;
    font-size: 0.9em;
}

.skill-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.skill-label {
    color: #aaa;
}

.skill-value {
    font-weight: bold;
    font-size: 1.2em;
}

.skill-progress-container {
    height: 8px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.skill-progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.skill-xp-text {
    text-align: center;
    font-size: 0.85em;
    color: #888;
}

/* Shop Category Tabs */
.shop-category-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.category-tab {
    padding: 10px 20px;
    background: rgba(30, 30, 50, 0.8);
    border: 2px solid #666;
    border-radius: 8px;
    color: #aaa;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-tab:hover {
    border-color: #888;
    color: #fff;
}

.category-tab.active {
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.2), rgba(69, 183, 170, 0.2));
    border-color: #4ecdc4;
    color: #4ecdc4;
}

/* Improved Shop Item Cards */
.shop-item .item-name {
    font-weight: bold;
    font-size: 1em;
    margin-bottom: 5px;
}

.shop-item .stat-row {
    display: flex;
    justify-content: center;
    font-size: 0.9em;
    margin: 3px 0;
}

.shop-item .stat-row.damage span,
.shop-item .stat-row.defense span {
    font-weight: bold;
    color: #4ecdc4;
}

.shop-item .stat-row.realm {
    color: #888;
    font-size: 0.8em;
}

/* Pill specific styling */
.pill-item .item-stats {
    text-align: center;
}
