/* Custom Managers Modal Styles */

.custom-manager-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    padding: 20px;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.custom-manager-modal {
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #1a1330 100%);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 20px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.7), 0 0 40px rgba(139, 92, 246, 0.15), 0 0 20px rgba(236, 72, 153, 0.1);
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-manager-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 36px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.25);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.03), rgba(236, 72, 153, 0.02));
}

.custom-manager-header h2 {
    font-family: 'Lora', serif;
    font-size: 32px;
    background: linear-gradient(135deg, #a78bfa 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.custom-manager-close {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 300;
}

.custom-manager-close:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.6);
    transform: scale(1.08);
}

.custom-manager-note {
    padding: 24px 36px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(59, 130, 246, 0.04));
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    border-left: 4px solid rgba(139, 92, 246, 0.6);
    color: #e5e7eb;
    line-height: 1.7;
    font-size: 14.5px;
    margin: 0;
}

.custom-manager-note strong {
    color: #c4b5fd;
    font-weight: 700;
    font-size: 15px;
}

.custom-manager-content {
    flex: 1;
    overflow-y: auto;
    padding: 28px 36px;
}

.custom-manager-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 24px;
}

.custom-manager-clear-btn {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    padding: 11px 22px;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Lora', serif;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.custom-manager-clear-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    transform: translateY(-1px);
}

/* Table Styles */
.custom-manager-table-wrapper {
    overflow-x: auto;
    margin-bottom: 36px;
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 14px;
    max-height: 420px;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.custom-manager-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Lora', serif;
}

.custom-manager-table thead {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(59, 130, 246, 0.08));
    position: sticky;
    top: 0;
    z-index: 10;
}

.custom-manager-table th {
    padding: 14px 18px;
    text-align: left;
    color: #c4b5fd;
    font-weight: 700;
    font-size: 13.5px;
    border-bottom: 2px solid rgba(139, 92, 246, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.custom-manager-table td {
    padding: 14px 18px;
    color: #e5e7eb;
    border-bottom: 1px solid rgba(139, 92, 246, 0.12);
    font-size: 14px;
}

.custom-manager-table tbody tr {
    transition: background 0.15s ease;
}

.custom-manager-table tbody tr:hover {
    background: rgba(139, 92, 246, 0.08);
}

.empty-state-row {
    text-align: center;
    color: #9ca3af;
    font-style: italic;
    padding: 50px 20px !important;
    font-size: 15px;
}

.rune-type-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: capitalize;
    letter-spacing: 0.3px;
}

.rune-type-badge.essence {
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.5);
}

.rune-type-badge.form {
    background: rgba(20, 184, 166, 0.2);
    color: #5eead4;
    border: 1px solid rgba(20, 184, 166, 0.5);
}

.rune-type-badge.additive {
    background: rgba(251, 191, 36, 0.2);
    color: #fcd34d;
    border: 1px solid rgba(251, 191, 36, 0.5);
}

.rune-tier-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
}

.rune-tier-badge:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.7);
    transform: scale(1.05);
}

.custom-rune-actions {
    display: flex;
    gap: 10px;
}

.custom-manager-edit-btn,
.custom-manager-delete-btn {
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Lora', serif;
}

.custom-manager-edit-btn {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #93c5fd;
}

.custom-manager-edit-btn:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.6);
    transform: translateY(-1px);
}

.custom-manager-delete-btn {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.custom-manager-delete-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.6);
    transform: translateY(-1px);
}

/* Add Section */
.custom-manager-add-section {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.06), rgba(59, 130, 246, 0.03));
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.custom-manager-add-section h3 {
    background: linear-gradient(135deg, #c4b5fd 0%, #93c5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 20px 0;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.custom-manager-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    align-items: center;
}

.custom-manager-form input,
.custom-manager-form select {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(139, 92, 246, 0.35);
    color: #e5e7eb;
    padding: 12px 16px;
    border-radius: 10px;
    font-family: 'Lora', serif;
    font-size: 14px;
    transition: all 0.2s ease;
}

.custom-manager-form input::placeholder {
    color: #9ca3af;
}

.custom-manager-form input:focus,
.custom-manager-form select:focus {
    outline: none;
    border-color: #a78bfa;
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.custom-manager-add-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    border: 1px solid rgba(139, 92, 246, 0.6);
    color: white;
    padding: 12px 28px;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Lora', serif;
    font-size: 14.5px;
    font-weight: 700;
    transition: all 0.2s ease;
    grid-column: span 2;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.custom-manager-add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(139, 92, 246, 0.5);
}

/* Synergy Grid */
.synergy-grid-wrapper {
    margin-bottom: 36px;
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 14px;
    max-height: 420px;
    overflow-y: auto;
    padding: 20px;
    background: rgba(0, 0, 0, 0.25);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.synergy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}

.synergy-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(20, 184, 166, 0.04));
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 12px;
    padding: 18px;
    transition: all 0.2s ease;
}

.synergy-card:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(20, 184, 166, 0.06));
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.synergy-card-content {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.synergy-rune {
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.synergy-rune.rune1 {
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.5);
}

.synergy-rune.rune2 {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.5);
}

.synergy-result {
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
    background: rgba(20, 184, 166, 0.2);
    color: #5eead4;
    border: 1px solid rgba(20, 184, 166, 0.5);
}

.synergy-plus-small,
.synergy-arrow-small {
    color: #9ca3af;
    font-size: 15px;
    font-weight: 700;
}

.synergy-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.synergy-form {
    display: flex;
    align-items: center;
    gap: 14px;
}

.synergy-plus,
.synergy-arrow {
    color: #a78bfa;
    font-size: 22px;
    font-weight: 700;
}

.synergy-form input {
    flex: 1;
}

.synergy-form .custom-manager-add-btn {
    grid-column: auto;
    flex-shrink: 0;
}

/* Scrollbar Styling */
.custom-manager-table-wrapper::-webkit-scrollbar,
.synergy-grid-wrapper::-webkit-scrollbar,
.custom-manager-content::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.custom-manager-table-wrapper::-webkit-scrollbar-track,
.synergy-grid-wrapper::-webkit-scrollbar-track,
.custom-manager-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.custom-manager-table-wrapper::-webkit-scrollbar-thumb,
.synergy-grid-wrapper::-webkit-scrollbar-thumb,
.custom-manager-content::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.4);
    border-radius: 10px;
}

.custom-manager-table-wrapper::-webkit-scrollbar-thumb:hover,
.synergy-grid-wrapper::-webkit-scrollbar-thumb:hover,
.custom-manager-content::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.6);
}

/* Responsive */
@media (max-width: 768px) {
    .custom-manager-modal {
        width: 95%;
        max-height: 95vh;
    }
    
    .custom-manager-header,
    .custom-manager-note,
    .custom-manager-content {
        padding: 16px 20px;
    }
    
    .custom-manager-form {
        grid-template-columns: 1fr;
    }
    
    .custom-manager-add-btn {
        grid-column: auto;
    }
    
    .synergy-grid {
        grid-template-columns: 1fr;
    }
    
    .synergy-form {
        flex-wrap: wrap;
    }
    
    .synergy-form input {
        width: 100%;
    }
}