/* ========================================
   FULL PAGE MODAL SYSTEM
   Modern, immersive design
   ======================================== */

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

body {
    font-family: 'Lora', serif;
    background: linear-gradient(135deg, #0a0a12 0%, #1a1a2e 100%);
    color: #ffffff;
    overflow-x: hidden;
}

/* Modal Overlay - Full Page */
.modal-fullpage-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #0a0a12 0%, #1a1a2e 100%);
    z-index: 999999;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

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

/* Modal Container */
.modal-fullpage-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header - Fixed at top */
.modal-fullpage-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 48px;
    background: linear-gradient(135deg, rgba(15, 15, 25, 0.98), rgba(20, 20, 35, 0.98));
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-bottom: 1px solid rgba(167, 139, 250, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.modal-header-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.modal-icon {
    width: 32px;
    height: 32px;
    stroke: #a78bfa;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.modal-title {
    font-size: 1.75rem;
    font-weight: 600;
    background: linear-gradient(135deg, #a78bfa 0%, #7bc9a6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.modal-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close-btn svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
}

.modal-close-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
    transform: scale(1.05);
}

/* Body - Scrollable content */
.modal-fullpage-body {
    flex: 1;
    padding: 48px;
    overflow-y: auto;
}

.modal-content-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Info Banner */
.info-banner {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.04));
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 16px;
    padding: 24px 28px;
    display: flex;
    align-items: flex-start;
    gap: 18px;
}

.info-banner svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    stroke: #4ade80;
    fill: none;
    stroke-width: 2;
    margin-top: 2px;
}

.info-banner-content {
    flex: 1;
}

.info-banner-title {
    color: #4ade80;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.info-banner-text {
    color: #86efac;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Form Card */
.form-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 36px;
    transition: all 0.3s ease;
}

.form-card:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(167, 139, 250, 0.2);
}

.form-card-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 28px;
}

.form-grid.synergy-form {
    grid-template-columns: 1fr auto 1fr auto 2fr;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.span-2 {
    grid-column: span 2;
}

.form-group label {
    color: #d1d5db;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 10px;
}

/* Form Inputs */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #ffffff;
    font-size: 1rem;
    font-family: 'Lora', serif;
    transition: all 0.2s ease;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(167, 139, 250, 0.5);
    box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: #6b7280;
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.6;
}

.form-select {
    cursor: pointer;
}

.form-help-text {
    display: block;
    margin-top: 8px;
    color: #6b7280;
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Synergy Operators */
.synergy-plus,
.synergy-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 8px;
}

.synergy-operator {
    font-size: 2rem;
    font-weight: 700;
    color: #7bc9a6;
    text-shadow: 0 0 20px rgba(123, 201, 166, 0.5);
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-primary {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #a78bfa 0%, #7bc9a6 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Lora', serif;
}

.btn-primary svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(167, 139, 250, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* List Card */
.list-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 36px;
}

.list-card-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Runes Grid */
.runes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* Rune Item Card */
.custom-rune-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all 0.3s ease;
}

.custom-rune-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(167, 139, 250, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(167, 139, 250, 0.2);
}

.rune-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.rune-item-name {
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 600;
    flex: 1;
    text-transform: capitalize;
}

.rune-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rune-type-badge.form {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.rune-type-badge.essence {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.rune-type-badge.additive {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.rune-tier-badge {
    font-size: 0.85rem;
    color: #7bc9a6;
    font-weight: 700;
    padding: 6px 12px;
    background: rgba(123, 201, 166, 0.15);
    border-radius: 10px;
    border: 1px solid rgba(123, 201, 166, 0.3);
}

.rune-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rune-item-details {
    color: #9ca3af;
    font-size: 0.95rem;
    line-height: 1.6;
}

.rune-item-runic {
    color: #c7d2fe;
    font-size: 0.9rem;
    font-style: italic;
    opacity: 0.8;
}

.rune-delete-btn {
    background: transparent;
    border: 1.5px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Lora', serif;
    align-self: flex-start;
}

.rune-delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.4);
    transform: scale(1.05);
}

/* Synergies Grid */
.synergies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

/* Synergy Item Card */
.synergy-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all 0.3s ease;
}

.synergy-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(167, 139, 250, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(167, 139, 250, 0.2);
}

.synergy-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.synergy-rune {
    color: #a78bfa;
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: capitalize;
}

.synergy-arrow {
    color: #7bc9a6;
    font-size: 1.5rem;
    font-weight: 700;
}

.synergy-result {
    color: #7bc9a6;
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: capitalize;
}

.synergy-delete-btn {
    background: transparent;
    border: 1.5px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Lora', serif;
    align-self: flex-start;
}

.synergy-delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.4);
    transform: scale(1.05);
}

/* Empty State */
.runes-empty-state,
.synergies-empty-state {
    text-align: center;
    padding: 80px 40px;
    color: #6b7280;
    grid-column: 1 / -1;
}

.runes-empty-state-icon,
.synergies-empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.runes-empty-state p,
.synergies-empty-state p {
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .runes-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .synergies-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .modal-fullpage-header {
        padding: 20px 24px;
    }
    
    .modal-title {
        font-size: 1.3rem;
    }
    
    .modal-icon {
        width: 24px;
        height: 24px;
    }
    
    .modal-fullpage-body {
        padding: 24px;
    }
    
    .form-card,
    .list-card {
        padding: 24px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .form-grid.synergy-form {
        grid-template-columns: 1fr;
    }
    
    .synergy-plus,
    .synergy-arrow {
        display: none;
    }
    
    .form-group.span-2 {
        grid-column: span 1;
    }
    
    .runes-grid,
    .synergies-grid {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar Styling */
.modal-fullpage-body::-webkit-scrollbar {
    width: 10px;
}

.modal-fullpage-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.modal-fullpage-body::-webkit-scrollbar-thumb {
    background: rgba(167, 139, 250, 0.3);
    border-radius: 10px;
}

.modal-fullpage-body::-webkit-scrollbar-thumb:hover {
    background: rgba(167, 139, 250, 0.5);
}