/**
 * YouBid Modal System Styles
 * Version: 1.0.0
 * 
 * This file contains the base styles for the modal system.
 * Additional styles are injected dynamically based on settings.
 */

/* Modal Base Styles - These are also defined in JS but included here for fallback */
.uwap-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 300ms ease-in-out;
}

.uwap-modal-overlay.show {
    opacity: 1;
}

.uwap-modal {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.7) translateY(-50px);
    transition: all 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.uwap-modal.show {
    transform: scale(1) translateY(0);
}

.uwap-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 25px;
    font-weight: 600;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.uwap-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.uwap-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    box-sizing: border-box;
    border: none;
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 200ms ease;
    z-index: 1;
}

.uwap-modal-close:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.uwap-modal-body {
    padding: 25px;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
}

.uwap-modal-footer {
    padding: 20px 25px;
    background: #f8f9fa;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid #e9ecef;
}

.uwap-modal-button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 200ms ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
    justify-content: center;
    text-decoration: none;
    box-sizing: border-box;
}

.uwap-modal-button:focus {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

.uwap-modal-button.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.uwap-modal-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.uwap-modal-button.primary:active {
    transform: translateY(0);
}

.uwap-modal-button.secondary {
    background: #6c757d;
    color: white;
}

.uwap-modal-button.secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* Countdown Timer Styles */
.uwap-countdown {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #dc3545;
}

.uwap-countdown-number {
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Button States */
.uwap-modal-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(50%);
    transform: none !important;
}

.uwap-modal-button.loading {
    position: relative;
    color: transparent;
}

.uwap-modal-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: uwap-spin 1s linear infinite;
}

/* Animations */
@keyframes uwap-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes uwap-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .uwap-modal {
        width: 95%;
        margin: 20px;
        max-height: 90vh;
    }
    
    .uwap-modal-header {
        padding: 15px 20px;
        font-size: 16px;
    }
    
    .uwap-modal-body {
        padding: 20px;
        font-size: 15px;
    }
    
    .uwap-modal-footer {
        padding: 15px 20px;
        flex-direction: column;
    }
    
    .uwap-modal-button {
        width: 100%;
        justify-content: center;
    }
    
    .uwap-modal-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
}

/* Touch Prevention for Mobile */
.uwap-modal-button.touch-prevented {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.uwap-modal-button.touch-prevented:active {
    background: inherit !important;
    transform: none !important;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .uwap-modal {
        border: 2px solid #000;
    }
    
    .uwap-modal-button {
        border: 2px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .uwap-modal-overlay,
    .uwap-modal,
    .uwap-modal-button,
    .uwap-modal-close {
        transition: none;
        animation: none;
    }
    
    .uwap-modal {
        transform: none;
    }
    
    .uwap-modal.show {
        transform: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .uwap-modal {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .uwap-modal-body {
        color: #e2e8f0;
    }
    
    .uwap-modal-footer {
        background: #1a202c;
        border-top-color: #4a5568;
    }
}

/* Print Styles */
@media print {
    .uwap-modal-overlay {
        display: none !important;
    }
}
