/* ==========================================================================
 * VMP Security All Options Page Styles
 * @package VMPFence
 * @since 2.2.2
   ========================================================================== */


/* Options Toolbar */
.vmpfence-options-toolbar {
    position: sticky;
    top: 32px;
    z-index: 100;
    background: #fff;
    border: 1px solid #ccd0d4;
    padding: 15px 20px;
    margin: 20px 20px 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    max-width: 95%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.vmpfence-search-container {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.vmpfence-search-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 3px;
    min-height: 40px !important;
}

.vmpfence-search-input:focus {
    border-color: #191970 !important;
    outline: none;
    box-shadow: 0 0 0 1px #191970 !important;
}

.vmpfence-search-message {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    padding: 8px 12px;
    color: #666;
    font-size: 12px;
    font-style: italic;
    margin-top: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
}

.vmpfence-toolbar-buttons {
    display: flex;
    gap: 8px;
}

.vmpfence-toolbar-buttons .button {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    height: auto;
    text-transform: uppercase;
    white-space: nowrap;
    min-width: 120px;
}

.vmpfence-btn-restore,
.vmpfence-btn-cancel {
    background: #fff;
    border: 1px solid #ddd;
    color: #555;
}

.vmpfence-btn-restore:hover,
.vmpfence-btn-cancel:hover {
    background: #f7f7f7;
    border-color: #999;
}

.vmpfence-btn-save {
    background: #191970 !important;
    border-color: #191970 !important;
    color: #fff;
}

.vmpfence-btn-save:hover {
    background: #1c1c8b !important;
    border-color: #1c1c8b !important;
}

.vmpfence-all-options-page {
    max-width: 1300px;
    background: #f5f7fa;
    padding: 10px;
}

.vmpfence-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.vmpfence-all-options-page h1 {
    color: #23282d;
    font-size: 23px;
    font-weight: 400;
    margin: 0;
    padding: 9px 0 4px;
    line-height: 1.3;
}

.vmpfence-expand-all {
    background: #fff;
    border: 1px solid #191970 !important;
    color: #191970 !important;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 3px;
    text-transform: uppercase;
    transition: all 0.2s;
}

.vmpfence-expand-all:hover {
    background: #1c1c8b !important;
    color: #fff !important;
}

.vmpfence-description {
    color: #666;
    font-size: 13px;
    margin: 0 0 20px 0;
    line-height: 1.6;
}

.all-options-section {
    margin-bottom: 30px;
}

.all-options-section-header {
    color: #23282d;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px 0;
    padding: 0;
    padding-bottom: 10px;
}

.vmpfence-accordion-item {
    border: 1px solid #ddd;
    margin-bottom: 10px;
    background: #fff;
    padding: 5px;
}

.vmpfence-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    background: #fff;
    transition: background 0.2s;
    user-select: none;
}

.vmpfence-accordion-header:hover {
    background: #f0f0f0;
}

.vmpfence-accordion-header span:first-child {
    color: #1d2327;
    font-size: 16px;
    font-weight: 600;
}

.vmpfence-accordion-arrow {
    color: #666;
    font-size: 20px;
    font-weight: 400;
    transition: transform 0.3s;
}

.vmpfence-accordion-item.active .vmpfence-accordion-arrow {
    transform: rotate(90deg);
}

.vmpfence-accordion-content {
    display: none;
    padding: 20px 16px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
}

.vmpfence-accordion-note {
    color: #666;
    font-size: 13px;
    margin: 0 0 12px 0;
}

.vmpfence-accordion-content .button {
    background: #191970;
    border-color: #191970;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    height: auto;
    line-height: 1.4;
}

.vmpfence-accordion-content .button:hover {
    background: #1c1c8b;
    border-color: #1c1c8b;
    color: #fff;
}

/* VMP Security License Section */
.vmpfence-license-container {
    background: #fff;
    padding: 20px 0;
}

.vmpfence-license-container h3 {
    margin: 0 0 20px 0;
    font-size: 15px;
    font-weight: 600;
    color: #23282d;
}

.vmpfence-license-key-group {
    margin-bottom: 20px;
}

.vmpfence-license-key-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 500;
    color: #23282d;
    font-size: 14px;
}

.vmpfence-license-key-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid #666;
    font-size: 11px;
    color: #666;
    cursor: help;
}

#vmpfence-license-key-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 13px;
    color: #333;
    font-family: monospace;
    cursor: text;
}

.vmpfence-license-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vmpfence-license-status-text {
    color: #23282d;
    font-size: 14px;
}

.vmpfence-license-status-value {
    font-weight: 500;
    font-size: 14px;
}

.vmpfence-license-status-value.premium {
    color: #28a745;
}

.vmpfence-license-status-value.free {
    color: #666;
}

.vmpfence-license-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

.vmpfence-license-actions form {
    margin: 0;
}

.vmpfence-license-actions .button-primary {
    display: inline;
}

.vmpfence-deactivate-btn {
    background: none;
    border: none;
    color: #0073aa;
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
}

.vmpfence-license-link {
    color: #0073aa;
    text-decoration: none;
    font-size: 13px;
}

.vmpfence-upgrade-btn,
.vmpfence-change-license-btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    height: auto;
    line-height: 1.4;
    min-width: 180px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.vmpfence-upgrade-btn {
    background: #191970;
    border-color: #191970;
    color: #fff;
}

.vmpfence-upgrade-btn:hover,
.vmpfence-upgrade-btn:focus {
    background: #0f0f4a;
    border-color: #0f0f4a;
    color: #fff;
}

.vmpfence-change-license-btn {
    background: #f0f0f1;
    border-color: #8c8f94;
    color: #2c3338;
}

.vmpfence-change-license-btn:hover,
.vmpfence-change-license-btn:focus {
    background: #e6e6e6;
    border-color: #8c8f94;
    color: #2c3338;
}

/* View Customization Section */
.vmpfence-view-customization {
    padding: 0;
}

.vmpfence-checkbox-item {
    padding: 12px 10px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 10px;
}

.vmpfence-checkbox-item:last-child {
    border-bottom: none;
}

.vmpfence-checkbox-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.vmpfence-checkbox-item input[type="checkbox"] {
    margin: 0 10px 0 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.vmpfence-checkbox-item span {
    color: #23282d;
    font-size: 14px;
    cursor: pointer;
}

/* Wordfence-style option rows (General VMP Security Options) */
.vmpfence-options-table {
    border: 1px solid #e6e6e6;
    background: #fff;
}

.vmpfence-option-row {
    display: grid;
    grid-template-columns: 44px 1fr 360px;
    gap: 20px;
    padding: 18px 20px;
    border-top: 1px solid #efefef;
    align-items: start;
}

.vmpfence-option-row:first-child {
    border-top: none;
}

.vmpfence-option-row--tall {
    align-items: start;
    grid-template-columns: 44px 1fr;
}

.vmpfence-option-row--tall .vmpfence-option-input {
    display: none;
}

.vmpfence-option-row--tall .vmpfence-radio-group {
    max-width: none;
    margin-top: 10px;
}

.vmpfence-option-check {
    display: flex;
    justify-content: center;
    padding-top: 2px;
}

.vmpfence-option-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.vmpfence-option-label {
    min-width: 0;
}

.vmpfence-option-title {
    font-size: 14px;
    color: #1d2327;
    font-weight: 600;
    line-height: 1.35;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.vmpfence-option-desc {
    margin-top: 8px;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.vmpfence-option-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid #9aa0a6;
    color: #6b7280;
    font-size: 11px;
    cursor: help;
    flex: 0 0 auto;
}

.vmpfence-option-input {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
}

.vmpfence-text-input {
    width: 100%;
    max-width: 360px;
    padding: 8px 10px !important;
    border: 1px solid #e0e0e0;
    border-radius: 2px;
    font-size: 14px !important;
    background: #fff;
}

.vmpfence-text-input:focus {
    border-color: #191970;
    box-shadow: 0 0 0 1px #191970;
    outline: none;
}

.vmpfence-text-input--small {
    max-width: 120px;
}

.vmpfence-radio-group {
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.vmpfence-radio-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    font-size: 14px;
    color: #1d2327;
    line-height: 1.5;
    cursor: pointer;
}

.vmpfence-radio-item input[type="radio"] {
    margin-top: 2px;
}

.vmpfence-option-note {
    margin-top: 14px;
    font-size: 13px;
    color: #1d2327;
}

.vmpfence-inline-link {
    display: inline-block;
    margin-top: 6px;
    color: #2271b1;
    text-decoration: none;
}

.vmpfence-inline-link:hover {
    text-decoration: underline;
}

/* Trusted proxies (hidden panel under IP detection) */
.vmpfence-trusted-proxies-panel {
    display: none;
    margin-top: 20px;
}

.vmpfence-trusted-proxy-row {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
    align-items: start;
    margin-top: 20px;
}

.vmpfence-trusted-proxy-row:first-child {
    margin-top: 0;
}

.vmpfence-trusted-proxy-title {
    font-size: 13px;
    color: #1d2327;
    font-weight: 400;
    line-height: 1.35;
}

.vmpfence-trusted-proxy-desc {
    margin-top: 4px;
    font-size: 12px;
    color: #666;
    line-height: 1.5;
}

.vmpfence-textarea,
.vmpfence-select {
    width: 100%;
    max-width: 340px;
    font-size: 13px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 2px;
}

.vmpfence-textarea {
    padding: 8px 10px;
    resize: vertical;
    min-height: 84px;
}

.vmpfence-select {
    padding: 6px 10px;
    height: 36px;
}

.vmpfence-textarea:focus,
.vmpfence-select:focus {
    border-color: #191970;
    box-shadow: 0 0 0 1px #191970;
    outline: none;
}

@media (max-width: 1100px) {
    .vmpfence-option-row {
        grid-template-columns: 44px 1fr;
    }
    .vmpfence-option-input {
        grid-column: 1 / -1;
        justify-content: flex-start;
        padding-left: 44px;
    }
    .vmpfence-text-input {
        max-width: 520px;
    }
}

/* ==========================================================================
 * License Change Modal Styles
   ========================================================================== */

#vmpfence-license-change-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
}

.vmpfence-license-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
    z-index: 99999;
}

.vmpfence-license-modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 550px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 100000;
}

.vmpfence-license-modal-content h2 {
    margin: 0 0 10px 0;
    font-size: 22px;
    color: #191970;
}

.vmpfence-license-modal-content > p {
    margin: 0 0 25px 0;
    color: #666;
    font-size: 14px;
}

.vmpfence-license-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.vmpfence-license-modal-close:hover {
    color: #333;
}

.vmpfence-form-group {
    margin-bottom: 20px;
}

.vmpfence-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.vmpfence-form-group label .required {
    color: #d63638;
}

.vmpfence-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.vmpfence-input:focus {
    outline: none;
    border-color: #191970;
    box-shadow: 0 0 0 1px #191970;
}

.vmpfence-field-description {
    margin: 5px 0 0 0;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.vmpfence-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal !important;
}

.vmpfence-checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.vmpfence-checkbox-label span {
    font-size: 14px;
    color: #333;
}

.vmpfence-error-message {
    padding: 12px;
    background: #fef0f0;
    border: 1px solid #d63638;
    border-radius: 4px;
    color: #d63638;
    font-size: 13px;
    margin-bottom: 20px;
}

.vmpfence-modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

.vmpfence-modal-buttons button {
    padding: 8px 16px;
    font-size: 14px;
}

.vmpfence-modal-buttons button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 600px) {
    .vmpfence-license-modal-content {
        padding: 20px;
        width: 95%;
    }
    
    .vmpfence-license-modal-content h2 {
        font-size: 18px;
    }
    
    .vmpfence-modal-buttons {
        flex-direction: column;
    }
    
    .vmpfence-modal-buttons button {
        width: 100%;
    }
}
