/* =====================================================
   ITEMS DATABASE - STYLESHEET
   ===================================================== */

/* Reset e Base */
body {
    background: #f5f7fa;
    color: #1e293b;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Hero Section */
.items-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 60px 20px;
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

.items-hero h1 {
    font-size: 48px;
    font-weight: 900;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.items-hero p {
    font-size: 20px;
    opacity: 0.95;
    margin-bottom: 0;
}

/* Container */
.items-container {
    display: flex;
    gap: 30px;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px 40px;
    align-items: flex-start;
}

/* Sidebar */
.items-sidebar {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
}

/* Main Content */
.items-main {
    flex: 1;
    min-width: 0;
}

/* Search Bar */
.search-bar {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.search-input-wrapper {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    color: #1e293b;
    font-size: 15px;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.search-input::placeholder {
    color: #94a3b8;
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
}

.filter-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: #667eea;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: all 0.3s;
}

.filter-btn:hover {
    background: #5568d3;
}

.filter-badge {
    background: #f59e0b;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
}

/* Filters Section */
.filters-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.filters-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f5f9;
}

.filters-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.filters-icon {
    font-size: 22px;
}

.filter-row {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-input {
    padding: 10px 12px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    color: #1e293b;
    font-size: 14px;
    transition: all 0.3s;
}

.filter-input:focus {
    outline: none;
    border-color: #667eea;
}

.filter-select {
    padding: 10px 12px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    color: #1e293b;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
}

/* Quality Badges */
.quality-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quality-badge {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.quality-badge:hover {
    transform: translateY(-2px);
}

.quality-badge.active {
    border-color: currentColor;
    box-shadow: 0 0 12px currentColor;
}

.quality-badge.white { background: #f3f4f6; color: #6b7280; border: 2px solid #d1d5db; }
.quality-badge.green { background: #d1fae5; color: #065f46; border: 2px solid #10b981; }
.quality-badge.blue { background: #dbeafe; color: #1e40af; border: 2px solid #3b82f6; }
.quality-badge.orange { background: #fed7aa; color: #9a3412; border: 2px solid #f97316; }
.quality-badge.gold { background: #fef3c7; color: #92400e; border: 2px solid #fbbf24; }
.quality-badge.purple { background: #ede9fe; color: #6b21a8; border: 2px solid #a855f7; }
.quality-badge.red { background: #fee2e2; color: #991b1b; border: 2px solid #ef4444; }

/* Results Info */
.results-info {
    background: #f8fafc;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: none;
    align-items: center;
    justify-content: space-between;
}

.results-info.active {
    display: flex;
}

.results-count {
    font-size: 14px;
    color: #475569;
    font-weight: 600;
}

/* Items List */
.items-list {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.items-list-header {
    display: grid;
    grid-template-columns: 60px 1fr 100px;
    padding: 15px 20px;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
}

.item-row {
    display: grid;
    grid-template-columns: 60px 1fr 100px;
    padding: 15px 20px;
    align-items: center;
    border-left: 4px solid #e2e8f0;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.3s;
}

.item-row:hover {
    background: #f8fafc;
}

.item-row:last-child {
    border-bottom: none;
}

/* Quality Border 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: #fbbf24; }
.item-row.quality-6 { border-left-color: #a855f7; }
.item-row.quality-7 { border-left-color: #ef4444; }

/* Item Content */
.item-icon {
    width: 40px;
    height: 40px;
    background: #f8fafc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
}

.item-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    image-rendering: pixelated;
}

.item-icon .placeholder {
    font-size: 24px;
}

.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: #d97706; }
.item-name.quality-6 { color: #9333ea; }
.item-name.quality-7 { color: #dc2626; }

.item-meta {
    font-size: 12px;
    color: #64748b;
    display: flex;
    gap: 12px;
}

.item-level {
    text-align: right;
    font-size: 14px;
    font-weight: 700;
    color: #64748b;
}

.item-level-value {
    color: #1e293b;
}

/* Empty & Loading States */
.empty-state,
.loading-state {
    text-align: center;
    padding: 80px 20px;
    color: #64748b;
    background: white;
    border-radius: 12px;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 20px;
    color: #1e293b;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 14px;
    color: #64748b;
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #f3f4f6;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
    padding: 20px;
}

.pagination button {
    padding: 10px 20px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    color: #1e293b;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.pagination button:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #667eea;
    color: #667eea;
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-info {
    color: #475569;
    font-weight: 600;
    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);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 1;
}

.modal-close:hover {
    background: #e2e8f0;
    transform: rotate(90deg);
}

.modal-header {
    padding: 30px 30px 20px;
    border-bottom: 2px solid #f1f5f9;
}

.modal-item-header {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.modal-item-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.modal-item-icon img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    image-rendering: pixelated;
}

.modal-item-info h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.modal-item-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.modal-badge {
    padding: 4px 12px;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.modal-badge.level {
    background: #ede9fe;
    color: #6b21a8;
}

.modal-badge.quality-1 { background: #f3f4f6; color: #6b7280; }
.modal-badge.quality-2 { background: #d1fae5; color: #065f46; }
.modal-badge.quality-3 { background: #dbeafe; color: #1e40af; }
.modal-badge.quality-4 { background: #fed7aa; color: #9a3412; }
.modal-badge.quality-5 { background: #fef3c7; color: #92400e; }
.modal-badge.quality-6 { background: #ede9fe; color: #6b21a8; }
.modal-badge.quality-7 { background: #fee2e2; color: #991b1b; }

.modal-body {
    padding: 25px 30px;
}

/* 3-column layout */
.modal-body-3col {
    display: grid;
    grid-template-columns: 300px 1fr 350px;
    gap: 25px;
    padding: 25px 30px;
}

.modal-col-left,
.modal-col-center,
.modal-col-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-title-3col {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.info-box {
    background: #f8fafc;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.info-label {
    color: #64748b;
    font-weight: 600;
}

.info-value {
    color: #1e293b;
    font-weight: 700;
}

.center-item-display {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
}

.center-item-icon {
    width: 64px;
    height: 64px;
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.center-item-icon img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    image-rendering: pixelated;
}

.center-item-name {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 14px;
}

.stat-label {
    color: #64748b;
    font-weight: 600;
}

.stat-value {
    font-weight: 700;
}

.modal-section {
    margin-bottom: 25px;
}

.modal-section:last-child {
    margin-bottom: 0;
}

.modal-section-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-bottom: 12px;
}

.modal-stats-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-stat {
    background: #f8fafc;
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.modal-stat-label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.modal-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-top: 4px;
}

.modal-description {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: #475569;
}

/* Enchant Section */
.enchant-box {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #fbbf24;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.enchant-header {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 12px;
}

.enchant-icon {
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.enchant-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    image-rendering: pixelated;
}

.enchant-info h3 {
    font-size: 16px;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 4px;
}

.enchant-id {
    font-size: 11px;
    color: #92400e;
    opacity: 0.7;
}

.enchant-description {
    background: rgba(255, 255, 255, 0.6);
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: #78350f;
    font-weight: 500;
}

/* Craft Section */
.craft-box {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 2px solid #3b82f6;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.craft-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.craft-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1e40af;
    margin: 0;
}

.craft-gold {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.6);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: #1e40af;
    font-weight: 600;
    margin-bottom: 15px;
}

.craft-gold-icon {
    font-size: 18px;
}

.craft-materials {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.craft-material {
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid #93c5fd;
    border-radius: 10px;
    padding: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
    transition: all 0.3s;
    cursor: pointer;
}

.craft-material:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    background: rgba(255, 255, 255, 1);
}

.craft-material-icon {
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.craft-material-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    image-rendering: pixelated;
}

.craft-material-info {
    flex: 1;
    min-width: 0;
}

.craft-material-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e3a8a;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.craft-material-qty {
    font-size: 12px;
    color: #1e40af;
    font-weight: 500;
}

.craft-material-arrow {
    margin-left: auto;
    color: #3b82f6;
    font-size: 20px;
    transition: transform 0.3s;
}

.craft-material:hover .craft-material-arrow {
    transform: translateX(5px);
}

/* Drop Section Styles */
.drop-list-modal {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.drop-item-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}

.drop-item-card:hover {
    background: #f1f5f9;
    border-color: #667eea;
}

.drop-item-type {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    background: #e0e7ff;
    color: #4338ca;
    white-space: nowrap;
}

.drop-item-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
}

.drop-item-meta {
    display: flex;
    gap: 8px;
    font-size: 11px;
}

.drop-qty {
    background: #dbeafe;
    color: #1e40af;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.drop-chance {
    background: #dcfce7;
    color: #166534;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.drop-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #64748b;
}

.drop-empty {
    text-align: center;
    padding: 20px;
    color: #94a3b8;
    font-size: 14px;
}

.drop-view-more {
    text-align: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}

.btn-view-more {
    display: inline-block;
    padding: 8px 16px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-view-more:hover {
    background: #5568d3;
    transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 1200px) {
    .modal-body-3col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .items-container {
        flex-direction: column;
    }

    .items-sidebar {
        width: 100%;
        position: relative;
        top: 0;
    }

    .items-main {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .items-hero h1 {
        font-size: 32px;
    }

    .items-hero p {
        font-size: 16px;
    }

    .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;
    }

    .search-input {
        padding: 12px 20px 12px 45px;
        font-size: 14px;
    }

    .filters-section {
        padding: 20px;
    }

    .modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .modal-header {
        padding: 20px 20px 15px;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}
