/**
 * Fancy Request Auction Modal - Modern Glassmorphism Design
 * Replaces basic browser prompts with beautiful modal
 */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.modal-container {
    position: relative;
    width: 90%;
    max-width: 480px; /* Made more compact from 720px */
    max-height: fit-content;
    overflow: visible;
    transform: scale(0.7) translateY(50px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

/* Modal Content */
.modal-content {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    padding: 0;
    backdrop-filter: blur(30px);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: visible;
}

/* Modal Header */
.modal-header {
    position: relative;
    padding: 1rem 1rem 0; /* Made more compact from 1.5rem */
    text-align: center;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #f59e0b 100%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: -200% 0; }
    50% { background-position: 200% 0; }
}

.modal-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    color: white;
    box-shadow: 
        0 20px 40px rgba(99, 102, 241, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.2),
        inset 0 -2px 0 rgba(0, 0, 0, 0.2);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 
            0 20px 40px rgba(99, 102, 241, 0.3),
            inset 0 2px 0 rgba(255, 255, 255, 0.2);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 
            0 25px 50px rgba(99, 102, 241, 0.4),
            inset 0 2px 0 rgba(255, 255, 255, 0.3);
    }
}

.modal-title {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 0;
}

/* Modal Body */
.modal-body {
    padding: 0.75rem 1rem; /* Made more compact from 1rem 1.5rem */
}

.domain-highlight {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.domain-name-display {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.domain-owner-info {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* Preset Price Display (for domains with pre-configured prices) */
.preset-price-display {
    margin-bottom: 1rem;
}

.preset-price-container {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    padding: 0.75rem;
    text-align: center;
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.preset-price-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer-preset 3s ease-in-out infinite;
}

@keyframes shimmer-preset {
    0% { left: -100%; }
    50% { left: 0%; }
    100% { left: 100%; }
}

.preset-price-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
    background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 50%, #c7d2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
}

.preset-price-note {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    position: relative;
    z-index: 1;
}

/* Enhanced Help Text for Preset Mode */
.preset-price-display .help-text {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 12px;
    padding: 0.75rem;
    margin-top: 1rem;
    color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
}

.preset-price-display .help-icon {
    color: rgba(245, 158, 11, 1);
    font-size: 1.1rem;
}

/* Responsive Design for Preset Price */
@media (max-width: 768px) {
    .preset-price-value {
        font-size: 2rem;
    }
    
    .preset-price-container {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .preset-price-value {
        font-size: 1.75rem;
    }
    
    .preset-price-note {
        font-size: 0.85rem;
    }
}

/* Form Group */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: white;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.price-input-container {
    position: relative;
}

.currency-symbol {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.25rem;
    font-weight: 700;
    z-index: 2;
}

.price-input {
    width: 100%;
    padding: 1rem 1rem 1rem 2.5rem;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    font-family: 'Space Grotesk', sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.price-input:focus {
    outline: none;
    border-color: #6366f1;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 0 0 4px rgba(99, 102, 241, 0.2),
        0 8px 32px rgba(99, 102, 241, 0.15);
    transform: translateY(-2px);
}

.price-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

/* Price Suggestions */
.price-suggestions {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* Grid layout for better alignment */
    gap: 0.75rem;
    margin-top: 1rem;
}

.price-suggestion {
    padding: 0.75rem 1rem; /* Slightly larger padding */
    background: rgba(255, 255, 255, 0.1); /* More visible background */
    border: 1px solid rgba(255, 255, 255, 0.2); /* More visible border */
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.9); /* More visible text */
    font-size: 0.875rem;
    font-weight: 600; /* Bolder text */
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px; /* Ensure consistent height */
}

.price-suggestion:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
    color: white;
    transform: translateY(-2px);
}

.price-suggestion:active {
    transform: scale(0.95);
}

/* Help Text */
.help-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.help-icon {
    color: rgba(245, 158, 11, 0.8);
}

/* Modal Footer */
.modal-footer {
    padding: 0 1rem 1rem; /* Made more compact from 0 1.5rem 1.5rem */
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn-modal {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 16px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-width: 120px;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.btn-modal-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-modal-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.25);
}

.btn-modal-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 10px 40px rgba(99, 102, 241, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-modal-primary:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 15px 50px rgba(99, 102, 241, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-modal-primary:active {
    transform: translateY(-1px);
}

.btn-modal:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Loading State */
.btn-modal.loading {
    position: relative;
    color: transparent;
}

.btn-modal.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Close Button */
.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.25);
}

/* Success State */
.modal-success .modal-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    animation: bounce 0.6s ease-out;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.modal-success .modal-header::before {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* Error State */
.modal-error .modal-icon {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    animation: shake 0.6s ease-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.modal-error .modal-header::before {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn-modal {
        width: 100%;
        padding: 1rem;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
    
    .price-suggestions {
        grid-template-columns: repeat(3, 1fr); /* 3 columns on mobile */
        gap: 0.5rem;
    }
    
    .modal-close {
        top: 1rem;
        right: 1rem;
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .modal-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .modal-title {
        font-size: 1.25rem;
    }
    
    .domain-name-display {
        font-size: 1.25rem;
    }
    
    .price-input {
        font-size: 1.1rem;
        padding: 0.875rem 0.875rem 0.875rem 2.25rem;
    }
}

/* Dark mode override for better contrast */
@media (prefers-color-scheme: dark) {
    .modal-content {
        background: rgba(15, 15, 15, 0.85);
        border-color: rgba(255, 255, 255, 0.2);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .modal-overlay,
    .modal-container,
    .modal-icon,
    .btn-modal,
    .price-input,
    .price-suggestion {
        transition: none;
        animation: none;
    }
    
    .modal-overlay.active .modal-container {
        transform: scale(1) translateY(0);
    }
}

/* Focus management for accessibility */
.modal-overlay:focus-within .modal-close:focus,
.modal-overlay:focus-within .btn-modal:focus,
.modal-overlay:focus-within .price-input:focus,
.modal-overlay:focus-within .price-suggestion:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .modal-content {
        border-width: 2px;
        border-color: rgba(255, 255, 255, 0.5);
    }
    
    .btn-modal-primary {
        border-width: 2px;
    }
    
    .price-input {
        border-width: 3px;
    }
}

/* FORCE NO SCROLLBARS */
.modal-overlay,
.modal-container,
.modal-content,
.modal-body,
.modal-overlay *,
.modal-container * {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

.modal-overlay::-webkit-scrollbar,
.modal-container::-webkit-scrollbar,
.modal-content::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.modal-overlay *::-webkit-scrollbar,
.modal-container *::-webkit-scrollbar {
    display: none !important;
}

/* Ensure modal fits content */
.modal-container {
    max-height: fit-content !important;
    overflow: visible !important;
}

.modal-content {
    max-height: fit-content !important;
    overflow: visible !important;
}

/* Make modal more compact */
.modal-header {
    padding: 0.75rem 1rem 0 !important;
}

.modal-body {
    padding: 0.5rem 1rem !important;
}

.modal-footer {
    padding: 0 1rem 0.75rem !important;
}

.domain-highlight {
    padding: 0.75rem !important;
    margin-bottom: 0.75rem !important;
}

.modal-icon {
    width: 48px !important;
    height: 48px !important;
    font-size: 1.5rem !important;
    margin: 0 auto 0.75rem !important;
}
