/**
 * WooCommerce Email OTP Verification - Modal Styles
 * 
 * Modern, responsive modal design with glassmorphism and animations
 * 
 * @package WC_Email_OTP
 * @version 1.0.0
 */

/* Modal Overlay */
.wc-otp-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: wcOtpFadeIn 0.3s ease-out;
}

.wc-otp-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Modal Content */
.wc-otp-modal-content {
    position: relative;
    width: 90%;
    max-width: 480px;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: wcOtpSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
}

/* Modal Header */
.wc-otp-modal-header {
    padding: 40px 32px 32px;
    text-align: center;
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    position: relative;
}

.wc-otp-modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: #ffffff;
    border-radius: 40px 40px 0 0;
}

.wc-otp-logo {
    max-width: 120px;
    height: auto;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.wc-otp-modal-header h2 {
    color: #ffffff;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 12px;
    line-height: 1.2;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wc-otp-description {
    color: rgba(255, 255, 255, 0.95);
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
    position: relative;
    z-index: 1;
}

/* Modal Body */
.wc-otp-modal-body {
    padding: 32px;
}

/* Alert Messages */
.wc-otp-alert {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: wcOtpSlideDown 0.3s ease-out;
}

.wc-otp-alert::before {
    content: '';
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.wc-otp-alert.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.wc-otp-alert.success::before {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    background: #10b981;
    color: #ffffff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
}

.wc-otp-alert.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.wc-otp-alert.error::before {
    content: '✕';
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: #ffffff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
}

.wc-otp-alert.info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.wc-otp-alert.info::before {
    content: 'ℹ';
    display: flex;
    align-items: center;
    justify-content: center;
    background: #3b82f6;
    color: #ffffff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
}

/* Input Group */
.wc-otp-input-group {
    margin-bottom: 24px;
}

.wc-otp-input-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.wc-otp-input {
    width: 100%;
    padding: 14px 18px;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 8px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
    color: #111827;
    transition: all 0.2s ease;
    font-family: 'Courier New', monospace;
}

.wc-otp-input:focus {
    outline: none;
    border-color: #7c3aed;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

.wc-otp-input::placeholder {
    color: #d1d5db;
    letter-spacing: 4px;
}

/* Timer */
.wc-otp-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: #fef3c7;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 600;
    color: #92400e;
}

.wc-otp-timer-icon {
    color: #f59e0b;
}

.wc-otp-timer.expired {
    background: #fee2e2;
    color: #991b1b;
}

.wc-otp-timer.expired .wc-otp-timer-icon {
    color: #ef4444;
}

/* Buttons */
.wc-otp-btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-family: inherit;
}

.wc-otp-btn-primary {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(124, 58, 237, 0.3);
}

.wc-otp-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(124, 58, 237, 0.4);
}

.wc-otp-btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.wc-otp-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wc-otp-btn-link {
    background: transparent;
    color: #7c3aed;
    padding: 8px 16px;
    font-size: 14px;
    width: auto;
}

.wc-otp-btn-link:hover:not(:disabled) {
    background: #f3f4f6;
    color: #5b21b6;
}

.wc-otp-btn-link:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading State */
.wc-otp-btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.wc-otp-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: wcOtpSpin 0.6s linear infinite;
}

/* Resend Section */
.wc-otp-resend {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.wc-otp-resend p {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 12px;
}

/* Modal Footer */
.wc-otp-modal-footer {
    padding: 20px 32px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.wc-otp-footer-text {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* Animations */
@keyframes wcOtpFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes wcOtpSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes wcOtpSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes wcOtpSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 640px) {
    .wc-otp-modal-content {
        width: 95%;
        border-radius: 20px;
    }
    
    .wc-otp-modal-header {
        padding: 32px 24px 24px;
    }
    
    .wc-otp-modal-header h2 {
        font-size: 24px;
    }
    
    .wc-otp-description {
        font-size: 14px;
    }
    
    .wc-otp-modal-body {
        padding: 24px;
    }
    
    .wc-otp-input {
        font-size: 20px;
        letter-spacing: 6px;
        padding: 12px 16px;
    }
    
    .wc-otp-modal-footer {
        padding: 16px 24px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .wc-otp-modal-content {
        background: #1f2937;
    }
    
    .wc-otp-modal-body {
        color: #f3f4f6;
    }
    
    .wc-otp-input {
        background: #374151;
        border-color: #4b5563;
        color: #f3f4f6;
    }
    
    .wc-otp-input:focus {
        background: #4b5563;
    }
    
    .wc-otp-input-group label {
        color: #e5e7eb;
    }
    
    .wc-otp-modal-footer {
        background: #111827;
        border-top-color: #374151;
    }
    
    .wc-otp-resend {
        border-top-color: #374151;
    }
}

/* Accessibility */
.wc-otp-btn:focus-visible {
    outline: 3px solid #7c3aed;
    outline-offset: 2px;
}

.wc-otp-input:focus-visible {
    outline: 3px solid #7c3aed;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .wc-otp-modal {
        display: none !important;
    }
}
