/* Premium Modal Enhancements */

/* Modal Overlay Improvements */
.modal-overlay {
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.modal-overlay.active {
    animation: fadeIn 0.3s ease-out;
}

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

/* Base Modal Styling */
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(145deg, #1e2139 0%, #252847 100%);
    border: 1px solid rgba(86, 100, 210, 0.2);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.modal.active {
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) translateY(0);
    }
}

/* Modal Header Styling */
.modal-header {
    background: linear-gradient(135deg, rgba(86, 100, 210, 0.1) 0%, rgba(118, 129, 247, 0.05) 100%);
    border-bottom: 1px solid rgba(86, 100, 210, 0.15);
    padding: 1.5rem 2rem;
    border-radius: 16px 16px 0 0;
    position: relative;
    flex-shrink: 0;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(86, 100, 210, 0.6) 20%, 
        rgba(118, 129, 247, 0.8) 50%, 
        rgba(86, 100, 210, 0.6) 80%, 
        transparent 100%
    );
}

.modal-header h3 {
    color: #f8f9fc;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.close-modal {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* Modal Content Styling */
.modal-content {
    background: transparent;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 85vh;
    overflow: hidden;
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}


.modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(86, 100, 210, 0.6) 0%, rgba(118, 129, 247, 0.4) 100%);
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(86, 100, 210, 0.8) 0%, rgba(118, 129, 247, 0.6) 100%);
}

.modal-body,.modal-content {
    padding: 2rem;
    color: #e2e8f0;
    overflow-y: auto;
    flex: 1;
    /* Custom scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: rgba(86, 100, 210, 0.3) rgba(255, 255, 255, 0.05);
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(86, 100, 210, 0.6) 0%, rgba(118, 129, 247, 0.4) 100%);
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(86, 100, 210, 0.8) 0%, rgba(118, 129, 247, 0.6) 100%);
}

/* Asset Selection Styling */
.asset-selection {
    margin-bottom: 1.5rem;
}

.selected-asset {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(86, 100, 210, 0.08) 0%, rgba(118, 129, 247, 0.04) 100%);
    border: 1px solid rgba(86, 100, 210, 0.2);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.selected-asset:hover {
    border-color: rgba(86, 100, 210, 0.35);
    background: linear-gradient(135deg, rgba(86, 100, 210, 0.12) 0%, rgba(118, 129, 247, 0.06) 100%);
}

.asset-icon {
    background: linear-gradient(135deg, #5664d2 0%, #7681f7 100%);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(86, 100, 210, 0.3);
}

.asset-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f8f9fc;
}

/* Input Container Styling */
.input-container {
    margin-bottom: 1.5rem;
}

.input-container label {
    display: block;
    margin-bottom: 0.75rem;
    color: #cbd5e0;
    font-weight: 500;
    font-size: 0.9rem;
}

.input-group {
    position: relative;
    margin-bottom: 0.75rem;
}

.input-group input {
    width: 100%;
    padding: 1rem 1.25rem;
    padding-right: 4rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(86, 100, 210, 0.2);
    border-radius: 12px;
    color: #f8f9fc;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.input-group input:focus {
    outline: none;
    border-color: rgba(86, 100, 210, 0.5);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
    box-shadow: 0 0 0 3px rgba(86, 100, 210, 0.1);
}

.max-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #5664d2 0%, #7681f7 100%);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.max-btn:hover {
    background: linear-gradient(135deg, #343f9e 0%, #5664d2 100%);
    transform: translateY(-50%) scale(1.05);
}

.balance-display {
    color: #a0aec0;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Transaction Summary Styling */
.transaction-summary {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.1) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row select {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
    border: 1px solid rgba(86, 100, 210, 0.2);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: #f8f9fc;
    font-weight: 500;
}

.summary-row select:focus {
    outline: none;
    border-color: rgba(86, 100, 210, 0.4);
}

/* Switch Styling */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: linear-gradient(135deg, #f8f9fc 0%, #e2e8f0 100%);
    transition: all 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
    background: linear-gradient(135deg, #5664d2 0%, #7681f7 100%);
    border-color: rgba(86, 100, 210, 0.5);
}

input:checked + .slider:before {
    transform: translateX(22px);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fc 100%);
}

/* Modal Action Button */
.modal-action-btn {
    width: 100%;
    padding: 1.25rem 2rem;
    background: linear-gradient(135deg, #5664d2 0%, #7681f7 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(86, 100, 210, 0.3);
}

.modal-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent
    );
    transition: left 0.5s ease;
}

.modal-action-btn:hover::before {
    left: 100%;
}

.modal-action-btn:hover {
    background: linear-gradient(135deg, #343f9e 0%, #5664d2 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(86, 100, 210, 0.4);
}

.modal-action-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(86, 100, 210, 0.3);
}

.modal-action-btn:disabled {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    color: rgba(255, 255, 255, 0.4);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Success and Error Modal Specific Styles */
#success-modal .modal-content,
#error-modal .modal-content {
    max-height: 500px;
}

#success-modal .modal-content {
    background: linear-gradient(145deg, #1a2f1a 0%, #0f3d0f 100%);
    border-color: rgba(72, 187, 120, 0.3);
}

#success-modal .modal-header {
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.15) 0%, rgba(72, 187, 120, 0.08) 100%);
    border-bottom-color: rgba(72, 187, 120, 0.2);
}

#success-modal .modal-header::before {
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(72, 187, 120, 0.6) 20%, 
        rgba(72, 187, 120, 0.8) 50%, 
        rgba(72, 187, 120, 0.6) 80%, 
        transparent 100%
    );
}

#success-modal .modal-body {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.success-icon {
    font-size: 4rem;
    color: #48bb78;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px rgba(72, 187, 120, 0.3));
}

#error-modal .modal-content {
    background: linear-gradient(145deg, #2f1a1a 0%, #3d0f0f 100%);
    border-color: rgba(229, 62, 62, 0.3);
}

#error-modal .modal-header {
    background: linear-gradient(135deg, rgba(229, 62, 62, 0.15) 0%, rgba(229, 62, 62, 0.08) 100%);
    border-bottom-color: rgba(229, 62, 62, 0.2);
}

#error-modal .modal-header::before {
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(229, 62, 62, 0.6) 20%, 
        rgba(229, 62, 62, 0.8) 50%, 
        rgba(229, 62, 62, 0.6) 80%, 
        transparent 100%
    );
}

#error-modal .modal-body {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.error-icon {
    font-size: 4rem;
    color: #e53e3e;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px rgba(229, 62, 62, 0.3));
}

/* Processing Modal Specific Styles */
#processing-modal .modal-content {
    background: linear-gradient(145deg, #1a1f2f 0%, #242947 100%);
    border-color: rgba(0, 198, 255, 0.3);
    max-height: 400px; /* Smaller height for processing modal */
}

#processing-modal .modal-header {
    background: linear-gradient(135deg, rgba(0, 198, 255, 0.15) 0%, rgba(0, 198, 255, 0.08) 100%);
    border-bottom-color: rgba(0, 198, 255, 0.2);
}

#processing-modal .modal-header::before {
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 198, 255, 0.6) 20%, 
        rgba(0, 198, 255, 0.8) 50%, 
        rgba(0, 198, 255, 0.6) 80%, 
        transparent 100%
    );
}

#processing-modal .modal-body {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* Spinner Enhancement */
.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 198, 255, 0.2);
    border-top: 4px solid #00c6ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    filter: drop-shadow(0 0 10px rgba(0, 198, 255, 0.3));
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .modal {
        width: 95%;
        max-width: none;
        max-height: 90vh;
        border-radius: 12px;
        margin: 0;
    }
    
    .modal-header {
        padding: 1.25rem 1.5rem;
    }
    
    .modal-header h3 {
        font-size: 1.2rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .asset-selection .selected-asset {
        padding: 0.75rem 1rem;
    }
    
    .asset-icon {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }
    
    .asset-name {
        font-size: 1rem;
    }
    
    .input-group input {
        padding: 0.875rem 1rem;
        padding-right: 3.5rem;
        font-size: 1rem;
    }
    
    .max-btn {
        right: 0.5rem;
        padding: 0.35rem 0.7rem;
    }
    
    .transaction-summary {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .summary-row {
        padding: 0.5rem 0;
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .summary-row select {
        width: 100%;
        padding: 0.75rem;
    }
    
    .modal-action-btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .modal {
        width: 98%;
        max-height: 95vh;
        border-radius: 8px;
    }
    
    .modal-header {
        padding: 1rem 1.25rem;
    }
    
    .modal-header h3 {
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: 1.25rem;
    }
    
    .input-container label {
        font-size: 0.85rem;
    }
    
    .balance-display {
        font-size: 0.8rem;
    }
    
    .close-modal {
        width: 28px;
        height: 28px;
    }
}

@media (max-height: 600px) {
    .modal {
        max-height: 95vh;
        top: 50%;
        transform: translate(-50%, -50%);
    }
    
    .modal-header {
        padding: 1rem 1.5rem;
    }
    
    .modal-body {
        padding: 1rem 1.5rem;
    }
}
select option {
  color: var(--text-color);           /* Text color */
  background-color: var(--bg-color); /* Background color */
  /* Some browsers may respect these */
}
