/* Items Database - Estilo Dashboard */

body {
    font-family: 'Poppins', sans-serif;
    background: #f8fafc;
}

/* Hero */
.items-hero {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    padding: 60px 20px;
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

.items-hero h1 {
    font-size: 42px;
    font-weight: 700;
    margin: 0 0 12px 0;
}

.items-hero p {
    font-size: 18px;
    margin: 0;
    opacity: 0.95;
}

/* Container */
.items-container {
    display: flex;
    gap: 30px;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

/* Sidebar */
.items-sidebar {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    align-self: flex-start;
}

.search-card,
.filter-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
    margin-bottom: 10px;
}

.search-input:focus {
    outline: none;
    border-color: #2563eb;
}

.clear-filters-btn {
    width: 100%;
    padding: 10px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-filters-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

.clear-filters-btn:active {
    background: #e2e8f0;
}

.filter-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 16px 0;
}

.filter-group {
    margin-bottom: 16px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 6px;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #2563eb;
}

/* Quality Badges */
.quality-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quality-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.quality-badge:hover {
    transform: translateY(-2px);
}

.quality-badge.active {
    border-color: currentColor;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.quality-badge.white { background: #f3f4f6; color: #6b7280; }
.quality-badge.green { background: #d1fae5; color: #065f46; }
.quality-badge.blue { background: #dbeafe; color: #1e40af; }
.quality-badge.orange { background: #fed7aa; color: #9a3412; }
.quality-badge.gold { background: #fef01b; color: #713f12; }
.quality-badge.purple { background: #ede9fe; color: #6b21a8; }
.quality-badge.red { background: #fee2e2; color: #991b1b; }

/* Main Content */
.items-main {
    flex: 1;
    min-width: 0;
}

.results-info {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: none;
}

.results-info.active {
    display: block;
}

.results-count {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
}

/* Items List */
.items-list {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.items-list-header {
    display: grid;
    grid-template-columns: 60px 1fr 100px;
    padding: 12px 20px;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
}

.item-row {
    display: grid;
    grid-template-columns: 60px 1fr 100px;
    padding: 16px 20px;
    align-items: center;
    border-left: 3px solid #e2e8f0;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.2s;
}

.item-row:hover {
    background: #f8fafc;
    border-left-color: #2563eb;
}

.item-row:last-child {
    border-bottom: none;
}

/* Quality Colors */
.item-row.quality-1 { border-left-color: #9ca3af; }
.item-row.quality-2 { border-left-color: #10b981; }
.item-row.quality-3 { border-left-color: #3b82f6; }
.item-row.quality-4 { border-left-color: #f59e0b; }
.item-row.quality-5 { border-left-color: #facc15; }
.item-row.quality-6 { border-left-color: #a855f7; }
.item-row.quality-7 { border-left-color: #ef4444; }

.item-icon {
    width: 48px;
    height: 48px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    image-rendering: pixelated;
}

.item-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.item-name {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.item-name.quality-1 { color: #6b7280; }
.item-name.quality-2 { color: #059669; }
.item-name.quality-3 { color: #2563eb; }
.item-name.quality-4 { color: #ea580c; }
.item-name.quality-5 { color: #eab308; }
.item-name.quality-6 { color: #9333ea; }
.item-name.quality-7 { color: #dc2626; }

.item-meta {
    font-size: 12px;
    color: #64748b;
}

.item-level {
    text-align: right;
    font-size: 14px;
    font-weight: 600;
    color: #2563eb;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 20px;
    color: #1e293b;
    margin: 0 0 8px 0;
}

.empty-state p {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

/* Loading */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #f3f4f6;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    padding: 20px;
}

.pagination button {
    padding: 10px 20px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #1e293b;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #2563eb;
    color: #2563eb;
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-info {
    color: #64748b;
    font-weight: 500;
    font-size: 14px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 1400px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 1;
}

.modal-close:hover {
    background: #e2e8f0;
}

/* Accordion Menu */
.accordion-item {
    margin-bottom: 8px;
}

.accordion-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.accordion-btn:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-color: #cbd5e1;
    transform: translateX(2px);
}

.accordion-btn.active {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #3b82f6;
    color: #1e40af;
}

.accordion-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.accordion-arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.2s;
}

.accordion-btn.active .accordion-arrow {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding: 0 8px;
}

.accordion-content.open {
    max-height: 1000px;
    padding: 12px 8px;
}

.accordion-subgroup {
    margin-bottom: 16px;
}

.accordion-subgroup:last-child {
    margin-bottom: 0;
}

.subgroup-title {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px 8px 8px;
    margin-bottom: 6px;
}

.filter-option {
    width: 100%;
    display: block;
    padding: 10px 12px;
    margin-bottom: 4px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.filter-option:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
    transform: translateX(4px);
}

.filter-option.active {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #3b82f6;
    color: #1e40af;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.filter-option:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Responsive */
@media (max-width: 1024px) {
    .items-container {
        flex-direction: column;
    }

    .items-sidebar {
        width: 100%;
        position: relative;
        top: 0;
    }
}

@media (max-width: 768px) {
    .items-hero h1 {
        font-size: 32px;
    }

    .items-list-header {
        display: none;
    }

    .item-row {
        grid-template-columns: 50px 1fr;
        gap: 12px;
    }

    .item-level {
        grid-column: 2;
        text-align: left;
        margin-top: 8px;
    }
}
