/* =================================================================
   UNDERGROUND FARMER - RESOURCES STYLES
   ================================================================= */

/* Resources toggle button */
.resources-toggle-btn {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border: 2px solid #3498db;
    border-radius: 8px;
    color: #ecf0f1;
    padding: 8px 12px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    min-width: 100px;
}

.resources-toggle-btn:hover {
    background: linear-gradient(135deg, #34495e, #3498db);
    border-color: #5dade2;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.resources-toggle-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.resources-icon {
    font-size: 16px;
}

.resources-text {
    flex: 1;
}

.resources-count {
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
}

/* Resources dialog */
.resources-dialog {
    position: fixed;
    top: 60px;
    right: 10px;
    width: 350px;
    max-height: 80vh;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border: 2px solid #3498db;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    z-index: 1000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    animation: resourcesDialogSlideIn 0.3s ease-out;
}

@keyframes resourcesDialogSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0) translateY(0);
    }
}

/* Dialog header */
.resources-dialog-header {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    border-bottom: 2px solid #3498db;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.resources-dialog-header h3 {
    color: #ecf0f1;
    margin: 0;
    font-size: 16px;
    font-weight: bold;
}

.resources-close-btn {
    background: transparent;
    border: none;
    color: #ecf0f1;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.resources-close-btn:hover {
    background: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

/* Dialog content */
.resources-dialog-content {
    max-height: calc(80vh - 60px);
    overflow-y: auto;
    padding: 12px 16px;
}

/* Scrollbar styling */
.resources-dialog-content::-webkit-scrollbar {
    width: 6px;
}

.resources-dialog-content::-webkit-scrollbar-track {
    background: rgba(52, 73, 94, 0.3);
    border-radius: 3px;
}

.resources-dialog-content::-webkit-scrollbar-thumb {
    background: rgba(52, 152, 219, 0.6);
    border-radius: 3px;
}

.resources-dialog-content::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 152, 219, 0.8);
}

/* Resource categories */
.resource-category {
    margin-bottom: 16px;
}

.resource-category:last-child {
    margin-bottom: 0;
}

.resource-category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.2), rgba(46, 204, 113, 0.2));
    border: 1px solid rgba(52, 152, 219, 0.4);
    border-radius: 8px;
    margin-bottom: 8px;
}

.category-icon {
    font-size: 18px;
}

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

/* Resource items */
.resource-category-items {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding-left: 8px;
}

.resource-item {
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.8), rgba(52, 73, 94, 0.8));
    border: 1px solid rgba(127, 140, 141, 0.3);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    cursor: default;
}

.resource-item:hover {
    background: linear-gradient(135deg, rgba(52, 73, 94, 0.9), rgba(44, 62, 80, 0.9));
    border-color: rgba(52, 152, 219, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.resource-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

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

.resource-name {
    color: #ecf0f1;
    font-size: 11px;
    font-weight: 500;
    margin-bottom: 2px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.resource-amount {
    color: #f39c12;
    font-size: 12px;
    font-weight: bold;
}

/* Special highlighting for non-zero resources */
.resource-item[data-resource-id] .resource-amount:not(:empty) {
    color: #2ecc71;
}

.resource-item[data-resource-id="coins"] .resource-amount {
    color: #f1c40f;
}

.resource-item[data-resource-id="energy"] .resource-amount {
    color: #f39c12;
}

/* Empty state */
.resource-amount:empty::after {
    content: '0';
    color: #7f8c8d;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .resources-dialog {
        right: 5px;
        left: 5px;
        width: auto;
        max-width: none;
    }
    
    .resource-category-items {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
    }
    
    .resources-toggle-btn {
        min-width: 80px;
        padding: 6px 8px;
    }
    
    .resources-text {
        display: none;
    }
}

@media (max-width: 360px) {
    .resource-category-items {
        grid-template-columns: 1fr;
    }
}

/* Animation for resource updates */
@keyframes resourceUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); color: #2ecc71; }
    100% { transform: scale(1); }
}

.resource-amount.updated {
    animation: resourceUpdate 0.3s ease-out;
}

/* Loading state */
.resources-loading {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
    font-style: italic;
}

/* Category collapse/expand (future feature) */
.resource-category-header.collapsible {
    cursor: pointer;
}

.resource-category-header.collapsible:hover {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.3), rgba(46, 204, 113, 0.3));
}

.resource-category.collapsed .resource-category-items {
    display: none;
}

.resource-category.collapsed .category-icon::after {
    content: ' ▶';
    font-size: 10px;
}

.resource-category:not(.collapsed) .category-icon::after {
    content: ' ▼';
    font-size: 10px;
} 