/**
 * Investors Gate Plugin - Styles
 */

/* Modal Overlay */
.investor-gate-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99998;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.investor-gate-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

/* Modal Content */
.investor-gate-modal-content {
    padding: 20px;
    position: relative;
    background: #ffffff;
    border-radius: 0;
    /* box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); */
    max-width: 100%;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
    animation: investorGateSlideIn 0.3s ease-out;
}

@keyframes investorGateSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Header */
.investor-gate-modal-header {
    margin-bottom: 24px;
}

.investor-gate-modal-header h2 {
    margin: 0 0 12px 0;
    font-size: 24px;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
    text-transform: none;
}

.investor-gate-modal-header-description {
    margin: 0;
    font-size: 14px;
    color: #000418;
    line-height: 1.5;
}

.investor-gate-modal-footer {
    margin: 20px 0;
    font-size: 14px;
    color: #000418;
    line-height: 1.6;
}

/* Form */
.investor-gate-fields-row {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.investor-gate-field {
    margin-bottom: 24px;
    flex: 1;
}

.investor-gate-fields-row .investor-gate-field {
    margin-bottom: 0;
}

.investor-gate-field:last-of-type {
    margin-bottom: 0;
}

.investor-gate-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    line-height: 1.5;
}

.investor-gate-field .required {
    color: #ef4444;
    margin-left: 4px;
}

.investor-gate-field select {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    line-height: 1.5;
    color: #111827;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23374151' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 40px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.investor-gate-field select:focus {
    outline: none;
    border-color: #000418;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.investor-gate-field select:invalid {
    color: #9ca3af;
}

.investor-gate-field select option {
    color: #111827;
}

/* Prevent Select2 from interfering with plugin selects */
.investor-gate-select,
#investor-type,
#investor-country {
    /* Ensure native select styling is preserved */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    width: 100% !important;
}

/* Hide Select2 containers if they somehow get created */
.investor-gate-modal .select2-container,
.investor-gate-modal .select2-dropdown {
    display: none !important;
}

/* Ensure Select2 doesn't hide our native selects */
.investor-gate-select.select2-hidden-accessible,
#investor-type.select2-hidden-accessible,
#investor-country.select2-hidden-accessible {
    position: relative !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    clip: auto !important;
    clip-path: none !important;
}

/* Checkbox */
.investor-gate-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
}

.investor-gate-checkbox-label input[type="checkbox"] {
    margin-right: 12px;
    margin-top: 2px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #000418;
}

.investor-gate-checkbox-label span {
    flex: 1;
    line-height: 1.6;
}

.investor-gate-terms-link {
    text-decoration: underline !important;
}

.investor-gate-terms-link:hover {
    text-decoration: none !important;
}

/* Error Messages */
.investor-gate-error {
    display: none;
    margin-top: 8px;
    font-size: 14px;
    color: #ef4444;
    line-height: 1.5;
}

.investor-gate-error:not(:empty) {
    display: block;
}

/* Actions */
.investor-gate-actions {
    margin-top: 32px;
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.investor-gate-submit {
    flex: 1;
    padding: 14px 24px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    background-color: #000418 !important;
    border: 1px solid #000418 !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease, transform 0.1s ease;
    line-height: 1.5 !important;
}

.investor-gate-submit:hover {
    color: #ffffff !important;
    background-color: #ffffff !important;
    border: 1px solid #000418 !important;
}

.investor-gate-submit:active {
    transform: scale(0.98) !important;
}

.investor-gate-submit:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.investor-gate-refuse {
    flex: 1;
    padding: 14px 24px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #000418;
    background-color: #ffffff !important;
    border: 1px solid #000418 !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease, transform 0.1s ease;
    line-height: 1.5 !important;
}

.investor-gate-refuse:hover {
    background-color: #000418 !important;
    color: #ffffff !important;
    border-color: #000418 !important;
}

.investor-gate-refuse:active {
    transform: scale(0.98);
}

.investor-gate-refuse:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.3);
}

/* Responsive Design */
@media (max-width: 640px) {
    .investor-gate-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .investor-gate-modal-header h2 {
        font-size: 20px;
    }

    .investor-gate-field {
        margin-bottom: 20px;
    }

    .investor-gate-actions {
        margin-top: 24px;
        flex-direction: column;
    }

    .investor-gate-fields-row {
        margin-top: 24px;
        flex-direction: column;
    }
    
    .investor-gate-submit,
    .investor-gate-refuse {
        width: 100%;
    }
}

/* Scrollbar Styling for Modal Content */
.investor-gate-modal-content::-webkit-scrollbar {
    width: 8px;
}

.investor-gate-modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.investor-gate-modal-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.investor-gate-modal-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

