/* ===================================
   CUSTOM POPUP SYSTEM STYLES
   Zero dependencies - Pure CSS
   =================================== */

/* Popup Container */
.custom-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.custom-popup.active {
    opacity: 1;
    visibility: visible;
}

/* Overlay */
.popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
}

/* Popup Container */
.popup-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transition: transform 0.3s;
    z-index: 1;
}

.custom-popup.active .popup-container {
    transform: translate(-50%, -50%) scale(1);
}

/* Close Button */
.popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(15, 23, 42, 0.1);
    color: #0F172A;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 2;
}

.popup-close:hover {
    background: #DC2626;
    color: white;
    transform: rotate(90deg);
}

/* Popup Content */
.popup-content {
    padding: 50px 40px 40px;
}

/* Popup Header */
.popup-header {
    text-align: center;
    margin-bottom: 32px;
}

.popup-header h2 {
    font-family: 'Crimson Pro', serif;
    font-size: 32px;
    font-weight: 900;
    color: #0F172A;
    margin-bottom: 12px;
}

.popup-header p {
    font-size: 16px;
    color: #64748B;
}

/* Popup Form */
.popup-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.popup-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.popup-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.popup-form label {
    font-weight: 600;
    color: #0F172A;
    font-size: 14px;
}

.popup-form input,
.popup-form select,
.popup-form textarea {
    padding: 14px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    font-family: 'Work Sans', sans-serif;
    font-size: 16px;
    color: #0F172A;
    transition: border-color 0.3s;
    background: white;
}

.popup-form input:focus,
.popup-form select:focus,
.popup-form textarea:focus {
    outline: none;
    border-color: #1E3A8A;
}

.popup-form input.error,
.popup-form select.error,
.popup-form textarea.error {
    border-color: #DC2626;
}

.popup-form textarea {
    resize: vertical;
    min-height: 100px;
}

/* Submit Button */
.popup-submit-btn {
    padding: 16px 32px;
    background: linear-gradient(135deg, #DC2626, #B91C1C);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
    font-family: 'Work Sans', sans-serif;
}

.popup-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4);
}

.popup-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Popup Note */
.popup-note {
    font-size: 12px;
    color: #94A3B8;
    text-align: center;
    margin-top: 8px;
}

/* Success Message */
.popup-success {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 900;
    margin: 0 auto 24px;
    animation: successPop 0.5s ease-out;
}

@keyframes successPop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.popup-success h3 {
    font-family: 'Crimson Pro', serif;
    font-size: 28px;
    font-weight: 900;
    color: #0F172A;
    margin-bottom: 12px;
}

.popup-success p {
    font-size: 16px;
    color: #64748B;
    line-height: 1.6;
    margin-bottom: 12px;
}

.success-subtext {
    font-size: 14px;
    color: #94A3B8;
}

.success-subtext a {
    color: #DC2626;
    font-weight: 700;
    text-decoration: none;
}

.success-subtext a:hover {
    text-decoration: underline;
}

/* Prevent body scroll when popup is open */
body.popup-open {
    overflow: hidden;
}

/* Loading State */
.btn-loader {
    display: inline-block;
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .popup-container {
        width: 95%;
        max-height: 95vh;
    }
    
    .popup-content {
        padding: 50px 24px 24px;
    }
    
    .popup-header h2 {
        font-size: 24px;
    }
    
    .popup-form .form-row {
        grid-template-columns: 1fr;
    }
    
    .popup-close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
        font-size: 28px;
    }
}

/* Smooth Scrollbar for Popup */
.popup-container::-webkit-scrollbar {
    width: 8px;
}

.popup-container::-webkit-scrollbar-track {
    background: #F1F5F9;
    border-radius: 0 16px 16px 0;
}

.popup-container::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}

.popup-container::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* Accessibility */
.popup-close:focus {
    outline: 2px solid #1E3A8A;
    outline-offset: 2px;
}

.popup-form input:focus,
.popup-form select:focus,
.popup-form textarea:focus {
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

/* Print Styles */
@media print {
    .custom-popup {
        display: none !important;
    }
}
