/* Call to Action Styles */
.call_toaction {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
    display: inline-block;
    text-decoration: none;
    min-width: 160px;
    text-align: center;
}

.call_toaction:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

.call_toaction:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
}

/* Modal Styles */
.call_toaction_popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}



/* Initial hidden state */
.call_toaction_popup {
    display: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* When modal is active/open */
.call_toaction_popup.modal-active {
    display: flex !important;
    visibility: visible;
    pointer-events: all;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(108, 117, 125, 0.8) 0%, 
        rgba(73, 80, 87, 0.85) 50%, 
        rgba(52, 58, 64, 0.9) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 10px 40px rgba(108, 117, 125, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: none;
    z-index: 9999;
}

@keyframes modalSlideIn {
    0% {
        transform: scale(0.7) translateY(-50px);
        opacity: 0;
        filter: blur(10px);
    }
    50% {
        transform: scale(1.02) translateY(-10px);
        opacity: 0.8;
        filter: blur(2px);
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
        filter: blur(0);
    }
}

.modal-header {
    padding: 25px 30px 20px 30px;
    border-bottom: 2px solid #f1f3f4;
    position: relative;
    background: linear-gradient(135deg, 
        #f8f9fa 0%, 
        #e9ecef 50%, 
        #dee2e6 100%);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.modal-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    letter-spacing: -0.5px;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 26px;
    cursor: pointer;
    color: #6c757d;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.close-modal:hover {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.modal-body {
    padding: 30px;
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 1) 0%, 
        rgba(248, 249, 250, 0.5) 100%);
    max-height: calc(90vh - 140px);
    overflow-y: auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 15px;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(248, 249, 250, 0.8);
    backdrop-filter: blur(10px);
    font-family: inherit;
}

.form-control:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 
        0 0 0 4px rgba(0, 123, 255, 0.15),
        0 4px 20px rgba(0, 123, 255, 0.1);
    background: white;
    transform: translateY(-2px);
}

.form-control:hover:not(:focus) {
    border-color: #adb5bd;
    background: rgba(255, 255, 255, 0.9);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px solid #f1f3f4;
    background: linear-gradient(180deg, 
        rgba(248, 249, 250, 0.5) 0%, 
        rgba(233, 236, 239, 0.3) 100%);
    margin-left: -30px;
    margin-right: -30px;
    padding-left: 30px;
    padding-right: 30px;
    margin-bottom: -30px;
    padding-bottom: 30px;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 120px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268, #495057);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(108, 117, 125, 0.4);
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-secondary:hover::before {
    left: 100%;
}

.btn-success {
    background: linear-gradient(135deg, #28a745, #20c997, #17a2b8);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-success:hover {
    background: linear-gradient(135deg, #218838, #1c7430, #138496);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.5);
}

.btn-success::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-success:hover::before {
    left: 100%;
}

body.modal-open {
    overflow: hidden;
}

/* Loading state */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Required field indicator */
.form-group label.required::after {
    content: " *";
    color: #dc3545;
}

/* Modal closing animation */
.call_toaction_popup.closing {
    animation: fadeOut 0.3s ease forwards;
}

.call_toaction_popup.closing .modal-content {
    animation: modalSlideOut 0.3s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards;
}

@keyframes fadeOut {
    from { 
        opacity: 1;
        backdrop-filter: blur(8px);
    }
    to { 
        opacity: 0;
        backdrop-filter: blur(0px);
    }
}

@keyframes modalSlideOut {
    0% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    100% {
        transform: scale(0.8) translateY(50px);
        opacity: 0;
        filter: blur(5px);
    }
}

/* Glass morphism effect */
.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 100%);
    border-radius: 20px;
    pointer-events: none;
    z-index: 1;
}

.modal-header, .modal-body {
    position: relative;
    z-index: 2;
}

/* Responsive Design */
@media (max-width: 576px) {
    .modal-content {
        width: 95%;
        margin: 20px auto;
        max-height: 95vh;
    }
    
    .modal-header, .modal-body {
        padding: 20px 15px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .call_toaction {
        width: 100%;
        padding: 15px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .modal-header h4 {
        font-size: 16px;
        padding-right: 40px;
    }
    
    .form-control {
        padding: 10px 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Animation for form validation */
.form-control.error {
    border-color: #dc3545;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 20%, 40%, 60%, 80% {
        transform: translateX(-5px);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(5px);
    }
    100% {
        transform: translateX(0);
    }
}

/* Success message styling */
.success-message {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #c3e6cb;
    margin: 15px 0;
    display: flex;
    align-items: center;
}

.success-message::before {
    content: "✓";
    font-weight: bold;
    margin-right: 10px;
    font-size: 18px;
}