/**
 * Modal Component Styles
 * Success modal and overlay styles for SO Form
 * @version 1.0.1
 */

/* Modal overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

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

/* Modal content */
.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 480px;
    width: 90%;
    animation: slideUp 0.3s ease;
    position: relative;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Success icon */
.modal-content .success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: #10B981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.5s ease;
}

.modal-content .success-icon i {
    font-size: 2.5rem;
    color: white;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

/* Modal header */
.modal-content h2 {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1F2937;
}

/* SO Number display */
.modal-content .so-number {
    display: block;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #4F46E5;
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background: #EEF2FF;
    border-radius: 8px;
}

/* Modal message */
.modal-content p {
    text-align: center;
    margin-bottom: 2rem;
    color: #6B7280;
    line-height: 1.6;
}

/* Button group */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Modal buttons */
.add-new-btn,
.print-btn {
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.add-new-btn {
    background: linear-gradient(135deg, #4F46E5 0%, #4338CA 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

.add-new-btn:hover {
    background: linear-gradient(135deg, #4338CA 0%, #3730A3 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px -1px rgba(79, 70, 229, 0.4);
}

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

.print-btn {
    background: white;
    border: 2px solid #E5E7EB;
    color: #374151;
}

.print-btn:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
    transform: translateY(-2px);
}

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

/* Icon styles */
.modal-content i {
    font-size: 1.125rem;
}

/* Button loading state */
.button-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.button-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-top: -9px;
    margin-left: -9px;
    border: 3px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: button-loading-spinner 0.6s linear infinite;
}

@keyframes button-loading-spinner {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Close button */
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border: none;
    background: #F3F4F6;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #6B7280;
}

.modal-close:hover {
    background: #E5E7EB;
    color: #374151;
}

.modal-close i {
    font-size: 1rem;
}

/* Responsive styles */
@media (max-width: 640px) {
    .modal-content {
        width: 95%;
        padding: 2rem 1.5rem;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-content h2 {
        font-size: 1.5rem;
    }

    .modal-content .so-number {
        font-size: 1.25rem;
        padding: 0.625rem;
    }

    .add-new-btn,
    .print-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
    }

    .modal-content .success-icon {
        width: 64px;
        height: 64px;
    }

    .modal-content .success-icon i {
        font-size: 2rem;
    }
}

/* Accessibility */
.modal-overlay:focus {
    outline: none;
}

.add-new-btn:focus,
.print-btn:focus,
.modal-close:focus {
    outline: 2px solid #4F46E5;
    outline-offset: 2px;
}

/* Print-specific styles */
@media print {
    .modal-overlay {
        display: none;
    }
}
