/* Form Container Styles */
.custom-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: Arial, Helvetica, sans-serif;
}

.form-section {
    margin-bottom: 20px;
}

.form-field {
    margin-bottom: 15px;
}

.form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #666;
}

/* Form Field Styles */
.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field textarea,
.form-field select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #fff;
    box-sizing: border-box;
}

/* Select Field Styles */
.form-field select {
    height: 45px;
    cursor: pointer;
    padding-right: 35px;
    background-image: linear-gradient(45deg, transparent 50%, #666 50%),
                     linear-gradient(135deg, #666 50%, transparent 50%);
    background-position: calc(100% - 20px) calc(50% + 2px),
                        calc(100% - 15px) calc(50% + 2px);
    background-size: 5px 5px,
                    5px 5px;
    background-repeat: no-repeat;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Hover States */
.form-field input:hover,
.form-field select:hover,
.form-field textarea:hover {
    border-color: #999;
}

/* Focus States */
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.2);
}

.form-field textarea {
    min-height: 120px;
    resize: vertical;
}

/* Radio Group Styles */
.radio-group {
    margin: 15px 0;
    display: flex;
    gap: 20px;
}

@media screen and (max-width: 550px) {
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }
}

.radio-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    margin-right: 8px;
}

/* Submit Button Styles */
.submit-button {
    background-color: #03787c;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.submit-button:hover {
    background-color: #014446;
    transform: translateY(-1px);
}

.submit-button:active {
    transform: translateY(0);
}

/* Info Popup Styles */
.info-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
}

.info-popup-content {
    position: relative;
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    max-width: 800px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.info-popup-close {
    position: absolute;
    right: 10px;
    top: 10px;
    font-size: 24px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
}

.info-popup-close:hover {
    color: #333;
}

.info-button {
    background: none;
    border: none;
    padding: 3px;
    cursor: pointer;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-top: -2px;
}

.info-button:hover {
    background-color: rgba(3, 120, 124, 0.1);
    transform: scale(1.1);
}

.info-button:active {
    transform: scale(0.95);
}

/* Message Styles */
#form-messages {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
    font-weight: 500;
}

#form-messages.success {
    background-color: #e7f7ed;
    color: #0c6b1d;
    border: 1px solid #a8e6b8;
}

#form-messages.error {
    background-color: #fdf2f2;
    color: #d32f2f;
    border: 1px solid #fac5c5;
}

.field-description {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

/* Required Field Indicator */
.required-field::after {
    content: ' *';
    color: #d32f2f;
}

.form-field label small {
    display: block;
    font-weight: normal;
    margin-top: 5px;
    line-height: 1.4;
}

/* Required Field Asterisk Style */
.form-field label > span.required,
.form-field label::after {
    color: #d32f2f !important;  /* Red color */
}

/* MSIC and Country Button Styles */
.msic-field-container,
.country-field-container {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.msic-field-container input,
.country-field-container input {
    flex: 1;
}

.msic-select-button,
.country-select-button {
    background-color: #03787c;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    height: 45px;
    white-space: nowrap;
}

.msic-select-button:hover,
.country-select-button:hover {
    background-color: #014446;
}

/* Popup Styles */
.msic-popup,
.country-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
}

.msic-popup-content,
.country-popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.msic-popup-header,
.country-popup-header {
    margin-bottom: 15px;
    position: relative;
}

.msic-popup-header h3,
.country-popup-header h3 {
    margin: 0 0 15px 0;
}

.msic-popup-close,
.country-popup-close {
    position: absolute;
    right: 0;
    top: 0;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

#msic-search,
#country-search {
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.msic-popup-body,
.country-popup-body {
    overflow-y: auto;
    max-height: calc(80vh - 120px);
}

.msic-item,
.country-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.msic-item:hover,
.country-item:hover {
    background-color: #f5f5f5;
}

.msic-code,
.country-code {
    font-weight: bold;
    margin-bottom: 5px;
}

.msic-description {
    font-size: 14px;
    color: #666;
}

.msic-category {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

.country-name {
    flex: 1;
    margin-left: 15px;
}

/* Readonly Field Styles */
input[readonly],
textarea[readonly] {
    background-color: #e5e5e5 !important;
    cursor: not-allowed;
}

/* Error State */
.form-field input.error,
.form-field select.error,
.form-field textarea.error {
    border-color: #d32f2f;
}

/* Admin Page Styles */
.nav-tab-wrapper {
    margin-bottom: 20px;
    border-bottom: 1px solid #ccc;
}

.nav-tab .count {
    color: #555;
    margin-left: 5px;
    font-size: 0.9em;
}

/* Admin Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999;
}

.modal-content {
    position: relative;
    background: #fff;
    margin: 5% auto;
    padding: 20px;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Super Specific Modal Close Button Override */
html body.wp-admin.wp-core-ui #submission-details-modal .close,
#wpwrap #wpcontent #wpbody #submission-details-modal .close {
    position: absolute !important;
    right: 20px !important;
    top: 10px !important;
    font-size: 24px !important;
    font-weight: normal !important;
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif !important;
    cursor: pointer !important;
    color: #3c434a !important;
    background: none !important;
    border: none !important;
    padding: 5px 10px !important;
    margin: 0 !important;
    text-decoration: none !important;
    line-height: 1 !important;
}

html body.wp-admin.wp-core-ui #submission-details-modal .close:hover,
#wpwrap #wpcontent #wpbody #submission-details-modal .close:hover {
    color: #135e96 !important;
}

/* Admin Table Styles */
.status-select {
    padding: 5px 10px;
    min-width: 120px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-weight: 500;
}

.status-select[data-status="processing"] {
    color: #004085 !important;
    border-color: #b8daff !important;
}

.status-select[data-status="valid"] {
    color: #155724 !important;
    border-color: #c3e6cb !important;
}

.status-select[data-status="invalid"] {
    color: #721c24 !important;
    border-color: #f5c6cb !important;
}

.status-select[data-status="email_sent"] {
    color: #0c5460 !important;
    border-color: #bee5eb !important;
}

.view-details {
    min-width: 100px;
}

/* Admin Details Modal Content */
#submission-details-content table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

#submission-details-content th {
    width: 200px;
    background-color: #f5f5f5;
    text-align: left;
    padding: 10px;
    border: 1px solid #ddd;
}

#submission-details-content td {
    padding: 10px;
    border: 1px solid #ddd;
}

/* Status Colors */
.status-select option[value="processing"] {
    color: #004085;
    background-color: #cce5ff;
}

.status-select option[value="valid"] {
    color: #155724;
    background-color: #d4edda;
}

.status-select option[value="invalid"] {
    color: #721c24;
    background-color: #f8d7da;
}

.status-select option[value="email_sent"] {
    color: #0c5460;
    background-color: #d1ecf1;
}

/* Responsive Design */
@media screen and (max-width: 782px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    #submission-details-content th {
        width: 140px;
    }
    
    .custom-form-container {
        padding: 10px;
    }
    
    .submit-button {
        width: 100%;
    }
}


/* Submission Details Styling */
.submission-details {
    padding: 20px 0;
}

.details-section {
    margin-bottom: 30px;
}

.details-section h3 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e5e5;
    color: #23282d;
}

.details-section table {
    border-collapse: collapse;
    width: 100%;
}

.details-section th {
    background-color: #f8f9fa;
    text-align: left;
    padding: 12px;
    border: 1px solid #e5e5e5;
    color: #23282d;
    font-weight: 600;
}

.details-section td {
    padding: 12px;
    border: 1px solid #e5e5e5;
    vertical-align: top;
}


.search-container {
    max-width: 800px;
    margin: 20px auto;
}

.search-box {
    margin: 20px 0;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    transition: all 0.3s ease;
    background-color: #fff;
}

.search-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.search-results {
    margin-top: 20px;
}

.search-result-item {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 10px;
    background-color: #fff;
    transition: all 0.3s ease;
}

.search-result-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-result-item h3 {
    margin: 0 0 10px 0;
    color: #1d2327;
    font-size: 16px;
}

.search-result-meta {
    display: flex;
    gap: 20px;
    color: #646970;
    font-size: 13px;
}

.search-result-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #646970;
    font-size: 15px;
    background: #f0f0f1;
    border-radius: 6px;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #646970;
}

@media screen and (max-width: 782px) {
    .search-result-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-result-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-result-actions .button {
        text-align: center;
    }
}


/* Email Verification Container */
.email-verification-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.email-field-container {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.email-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
    font-size: 14px;
    color: #666;
}

.verification-indicator {
    color: #d32f2f;
    font-weight: 500;
}

.verify-email-button {
    background-color: #03787c;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    height: 45px;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.verify-email-button:hover {
    background-color: #014446;
}



/* Email Verification Popup Styles */
.email-verification-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.email-verification-popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.email-verification-popup h3 {
    color: #333;
    margin: 0 0 20px 0;
    font-size: 24px;
}

.email-verification-popup p {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
}

.verification-code-input {
    width: 200px;
    margin: 0 auto 20px;
    padding: 12px;
    font-size: 18px;
    text-align: center;
    letter-spacing: 4px;
    border: 2px solid #ddd;
    border-radius: 6px;
}

.verification-code-input:focus {
    border-color: #03787c;
    outline: none;
    box-shadow: 0 0 0 3px rgba(3, 120, 124, 0.1);
}

.verify-code-button {
    background-color: #03787c;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.verify-code-button:hover {
    background-color: #014446;
}

.popup-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
}

.popup-close:hover {
    color: #333;
}

.verification-code-input {
    width: 200px;
    margin: 0 auto 20px;
    padding: 12px;
    font-size: 18px;
    text-align: center;
    letter-spacing: 4px; /* This controls the spacing between characters */
    font-family: monospace; /* This ensures all characters have the same width */
    border: 2px solid #ddd;
    border-radius: 6px;
}

.verification-code-input::placeholder {
    letter-spacing: 6px; /* Adjust placeholder spacing to match input */
    font-family: monospace;
}

.popup-title {
    font-size: 18px;
    font-weight: 700;
    color: #03787c; /* Match the teal color used in the info icon */
    text-align: center;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 5px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Custom File Upload Styles for WUIF */
.custom-file-upload {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.custom-file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    left: -9999px;
}

.custom-file-label {
    display: inline-block;
    padding: 12px 24px;
    background-color: #03787c;
    color: white !important;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
    margin-bottom: 0 !important;
    text-align: center;
    min-width: 150px;
    white-space: nowrap;
}

.custom-file-label:hover {
    background-color: #025f62;
}

.file-text {
    display: inline-block;
    color: #666;
    font-style: italic;
    flex: 1;
}