* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Password warning banner */
.password-warning {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff3cd;
    color: #664d03;
    border: 1px solid #ffecb5;
    padding: 12px 20px;
    font-size: 0.95em;
    font-weight: 500;
}

.password-warning code {
    background: rgba(0,0,0,0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.password-warning-icon {
    font-size: 1.4em;
    flex-shrink: 0;
}

.password-warning-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.3em;
    cursor: pointer;
    color: #664d03;
    opacity: 0.7;
    flex-shrink: 0;
}

.password-warning-close:hover {
    opacity: 1;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.stat-box {
    background: rgba(255,255,255,0.1);
    padding: 15px 30px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.stat-box .number {
    font-size: 2em;
    font-weight: bold;
    display: block;
}

.stat-box .label {
    font-size: 0.9em;
    opacity: 0.8;
}

.filters {
    padding: 30px;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 12px 20px;
    font-size: 1em;
    border: 2px solid #dee2e6;
    border-radius: 25px;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #dee2e6;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95em;
    font-weight: 500;
}

.filter-btn:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Item Filter */
.item-filter select {
    padding: 10px 16px;
    font-size: 0.95em;
    border: 2px solid #dee2e6;
    border-radius: 20px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23495057' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.item-filter select:hover {
    border-color: #667eea;
}

.item-filter select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* View Toggle */
.view-btn {
    padding: 8px 15px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.view-btn:hover {
    background: #f1f3f5;
}

.view-btn.active {
    background: #495057;
    color: white;
    border-color: #495057;
}

/* Table View */
.enchantments-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.enchantments-table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
}

.enchantments-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.enchantments-table tr:hover {
    background: #f8f9ff;
}

.enchantments-table .edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    padding: 5px;
    border-radius: 5px;
}

.enchantments-table .edit-btn:hover {
    background: rgba(0,0,0,0.05);
}

.enchantments-grid {
    padding: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.enchantment-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
    cursor: pointer;
}

.enchantment-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.enchantment-card.vanilla {
    border-left: 4px solid #28a745;
}

.enchantment-card.enchantment_expansion {
    border-left: 4px solid #dc3545;
}

.enchantment-card.fishing_expansion {
    border-left: 4px solid #17a2b8;
}

.enchantment-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
}

.enchantment-name {
    font-size: 1.3em;
    font-weight: bold;
    color: #2c3e50;
}

.enchantment-level {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 0.9em;
}

.enchantment-level.level-na {
    background: #adb5bd;
    font-size: 0.8em;
    opacity: 0.7;
}

.enchantment-description {
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 10px;
}

.enchantment-source {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
}

.source-vanilla {
    background: #d4edda;
    color: #155724;
}

.source-enchantment_expansion {
    background: #f8d7da;
    color: #721c24;
}

.source-fishing_expansion {
    background: #d1ecf1;
    color: #0c5460;
}

.enchantment-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.75em;
    font-weight: 500;
    margin-right: 5px;
}

.tag-craftable {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #bbdefb;
}

.tag-lootable {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffe0b2;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    grid-column: 1 / -1;
}

.no-results h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

footer {
    background: #2c3e50;
    color: white;
    padding: 30px;
    text-align: center;
}

footer a {
    color: #667eea;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }
    
    .enchantments-grid {
        grid-template-columns: 1fr;
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Gear Icon */
.enchantment-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    padding: 5px;
    opacity: 0.5;
    transition: all 0.2s;
    border-radius: 50%;
}

.edit-btn:hover {
    opacity: 1;
    background: #f1f3f5;
    transform: rotate(45deg);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
    animation: slideDown 0.3s ease-out;
}

/* Detail modal */
.detail-modal-content {
    background-color: white;
    margin: 4% auto;
    padding: 35px;
    border-radius: 15px;
    width: 90%;
    max-width: 620px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
    animation: slideDown 0.3s ease-out;
}

.detail-modal-content .modal-header {
    border-bottom: 3px solid #e9ecef;
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.detail-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detail-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.detail-level {
    font-weight: 600;
    color: #495057;
    font-size: 0.95rem;
}

.detail-short-desc {
    font-size: 1rem;
    color: #343a40;
    line-height: 1.5;
    font-style: italic;
}

.detail-divider {
    border: none;
    border-top: 1px solid #e9ecef;
    margin: 4px 0;
}

.detail-full-desc {
    font-size: 0.95rem;
    color: #495057;
    line-height: 1.7;
    white-space: pre-line;
}

.detail-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-section strong {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
}

.detail-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.detail-obtain {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.table-name-link {
    cursor: pointer;
    color: #5b4a8a;
    transition: color 0.2s;
}

.table-name-link:hover {
    color: #7c3aed;
    text-decoration: underline;
}

.enchantment-card {
    cursor: pointer;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 2px solid #f8f9fa;
    padding-bottom: 15px;
}

.close-btn {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #adb5bd;
}

.close-btn:hover {
    color: #212529;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1em;
}

.form-row {
    display: flex;
    gap: 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
}

.btn-save, .btn-cancel {
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1em;
    transition: all 0.2s;
}

.btn-save {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-cancel {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #dee2e6;
}

.btn-cancel:hover {
    background: #e9ecef;
}

/* Auth Button */
.auth-btn {
    padding: 8px 15px;
    border: 2px solid #6c757d;
    background: #6c757d;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.auth-btn:hover {
    background: #5a6268;
    border-color: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(108, 117, 125, 0.3);
}

.auth-btn.auth-unlocked {
    background: #17a2b8;
    border-color: #17a2b8;
}

.auth-btn.auth-unlocked:hover {
    background: #138496;
    border-color: #138496;
    box-shadow: 0 3px 10px rgba(23, 162, 184, 0.3);
}

/* Add Button */
.add-btn {
    padding: 8px 15px;
    border: 2px solid #28a745;
    background: #28a745;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.add-btn:hover {
    background: #218838;
    border-color: #218838;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.3);
}

/* Delete Button */
.delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1em;
    padding: 5px;
    opacity: 0.4;
    transition: all 0.2s;
    border-radius: 50%;
}

.delete-btn:hover {
    opacity: 1;
    background: #ffe0e0;
}

.btn-delete {
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1em;
    transition: all 0.2s;
    background: #dc3545;
    color: white;
    border: none;
}

.btn-delete:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
}

/* Action buttons container */
.action-buttons {
    display: flex;
    gap: 5px;
    align-items: center;
}

/* Item tags (applies_to) */
.enchantment-items {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.table-items {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.item-tag {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.7em;
    font-weight: 600;
    background: #e9ecef;
    color: #495057;
    border: 1px solid #dee2e6;
}

.item-tag-all { background: #d4edda; color: #155724; border-color: #c3e6cb; }
.item-tag-sword { background: #ffeeba; color: #856404; border-color: #ffd351; }
.item-tag-axe { background: #ffeeba; color: #856404; border-color: #ffd351; }
.item-tag-pickaxe { background: #d6d8db; color: #383d41; border-color: #c6c8ca; }
.item-tag-shovel { background: #d6d8db; color: #383d41; border-color: #c6c8ca; }
.item-tag-hoe { background: #d6d8db; color: #383d41; border-color: #c6c8ca; }
.item-tag-bow { background: #f5c6cb; color: #721c24; border-color: #f1b0b7; }
.item-tag-crossbow { background: #f5c6cb; color: #721c24; border-color: #f1b0b7; }
.item-tag-trident { background: #b8daff; color: #004085; border-color: #9fcdff; }
.item-tag-spear { background: #b8daff; color: #004085; border-color: #9fcdff; }
.item-tag-mace { background: #d4c5f9; color: #4a148c; border-color: #c4b0f0; }
.item-tag-helmet { background: #c3fdff; color: #006064; border-color: #a0e8eb; }
.item-tag-chestplate { background: #c3fdff; color: #006064; border-color: #a0e8eb; }
.item-tag-leggings { background: #c3fdff; color: #006064; border-color: #a0e8eb; }
.item-tag-boots { background: #c3fdff; color: #006064; border-color: #a0e8eb; }
.item-tag-shield { background: #fff3cd; color: #664d03; border-color: #ffe69c; }
.item-tag-elytra { background: #e2d9f3; color: #563d7c; border-color: #c5b3e6; }
.item-tag-fishing-rod { background: #d1ecf1; color: #0c5460; border-color: #bee5eb; }
.item-tag-shears { background: #d6d8db; color: #383d41; border-color: #c6c8ca; }

/* Modal checkboxes grid for applies_to */
.item-checkboxes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 10px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.item-cb {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85em;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    padding: 3px 5px;
    border-radius: 4px;
    transition: background 0.15s;
}

.item-cb:hover {
    background: #e9ecef;
}

.item-cb input[type="checkbox"] {
    cursor: pointer;
}

