/* FormPays Pro Settings - Modern Card Layout */

.formpays-pro-settings-wrap {
    background: #f8f9fa;
    min-height: 100vh;
    margin: 20px 0px 0 -20px;
    padding: 20px;
}

.formpays-pro-header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.formpays-pro-header h1 {
    margin: 0;
    color: #1a1a1a;
    font-size: 28px;
    font-weight: 600;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.settings-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-top: 20px;
}

.settings-card.full-width {
    grid-column: 1 / -1;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gateway-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.gateway-icon.payu { background: #00a0d2; }
.gateway-icon.stripe { background: #635bff; }
.gateway-icon.paypal { background: #0070ba; }
.gateway-icon.razorpay { background: #3395ff; }
.gateway-icon.test { background: #3b3b3b; }
.gateway-icon.instamojo { background: #df542f; }
.gateway-icon.phonepe { background: #5a07f4; }

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .slider {
    background-color: #28a745; /* Green when enabled */
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(26px);
}

/* Disabled state styling */
.gateway-accordion.disabled .toggle-switch .slider {
    background-color: #dc3545; /* Red when disabled */
}

.gateway-accordion.enabled .toggle-switch .slider {
    background-color: #28a745; /* Green when enabled */
}

.card-content {
    padding: 20px;
}

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

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #1a1a1a;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input[type="checkbox"]
{
    width: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.form-group .description {
    margin-top: 6px;
    font-size: 13px;
    color: #666;
}

.mode-toggle {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.mode-toggle .switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.mode-toggle .switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mode-toggle .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.mode-toggle .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.mode-toggle input:checked + .slider {
    background-color: #007cba;
}

.mode-toggle input:checked + .slider:before {
    transform: translateX(26px);
}

.mode-label {
    font-weight: 500;
    color: #1a1a1a;
}

.credentials-section {
    margin-top: 20px;
}

.credentials-section h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.credentials-section .description {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
}

.gateway-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gateway-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.gateway-item.enabled {
    background: #f0f8ff;
    border-color: #007cba;
}

.gateway-item.disabled {
    background: #f9f9f9;
    border-color: #ddd;
    opacity: 0.7;
}

.gateway-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gateway-item-name {
    font-weight: 500;
    color: #1a1a1a;
}

.gateway-status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.gateway-status.enabled {
    background: #d4edda;
    color: #155724;
}

.gateway-status.disabled {
    background: #f8d7da;
    color: #721c24;
}

.save-button {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.save-button:hover {
    background: #005a87;
}

.save-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.spinner {
    display: none;
    margin-left: 10px;
}

.status-message {
    color: #46b450;
    font-weight: bold;
    font-size: 12px;
}

/* Server Limits Grid */
.server-limits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.server-limit-item {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.server-limit-value {
    color: #666;
}

.server-limits-recommendations {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.server-limits-recommendations ul {
    margin: 10px 0;
    padding-left: 20px;
}

/* Gateway Info Section */
.formpays-pro-gateway-info {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.formpays-pro-gateway-info h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.formpays-pro-gateway-info ul {
    margin: 0 0 20px 0;
    padding-left: 20px;
    color: #666;
}

.formpays-pro-gateway-info code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
}

.formpays-pro-test-connection {
    margin-top: 15px;
}

.formpays-pro-test-connection .button {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.formpays-pro-test-connection .spinner {
    float: none;
    margin-left: 10px;
}

.formpays-pro-test-connection #test-result {
    margin-top: 10px;
}

/* Save Button Container */
.save-button-container {
    text-align: right;
    margin-top: 20px;
}

/* Common Settings H3 */
.form-group h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.form-group h3:not(:first-child) {
    margin-top: 20px;
}

/* Gateway Accordion Styles */
.gateway-accordion {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.gateway-accordion.enabled {
    border-color: #007cba;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.15);
}

.gateway-accordion.disabled {
    border-color: #ddd;
    opacity: 0.8;
}

.accordion-header {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.3s ease;
}

.accordion-header:hover {
    background: #e9ecef;
}

.gateway-header-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.gateway-header-details h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.gateway-header-details .gateway-status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
    margin-top: 4px;
}

.accordion-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.accordion-arrow {
    font-size: 12px;
    color: #666;
    transition: transform 0.3s ease;
}

.accordion-arrow.open {
    transform: rotate(180deg);
}

.accordion-content {
    padding: 0;
    background: white;
}

.gateway-settings-content {
    padding: 20px;
}

.gateway-disabled-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    background: #f8f9fa;
    border-radius: 6px;
    margin: 20px 0;
}

.gateway-save-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    text-align: right;
}

.save-gateway-button {
    background: #007cba;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.save-gateway-button:hover {
    background: #005a87;
}

.gateway-settings-inner {
    margin: 0;
}

.gateway-settings-inner .formpays-pro-gateway-info {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.gateway-settings-inner .formpays-pro-gateway-info h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

/* Gateway Mode Toggle */
.gateway-mode-toggle {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.mode-toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.mode-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mode-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ff9500; /* Orange for test mode (default) */
    transition: .4s;
    border-radius: 30px;
}

.mode-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Live Mode (checked) - Green */
.mode-toggle-switch input:checked + .mode-slider {
    background-color: #28a745; /* Green for live mode */
}

.mode-toggle-switch input:checked + .mode-slider:before {
    transform: translateX(30px);
}

.gateway-mode-toggle .mode-label {
    font-weight: 600;
    font-size: 16px;
    color: #1a1a1a;
    margin: 0;
}

.common-settings-save {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    text-align: right;
}

/* Email Notifications Row */
.email-notifications-row {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 10px;
}

.email-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #1a1a1a;
    margin: 0;
    white-space: nowrap;
}

.email-checkbox-label input[type="checkbox"] {
    margin: 0;
    width: auto;
}

.admin-email-field {
    flex: 1;
    min-width: 200px;
}

.admin-email-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #1a1a1a;
}

.admin-email-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.admin-email-field input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

/* Responsive adjustments for email row */
@media (max-width: 768px) {
    .email-notifications-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .admin-email-field {
        min-width: auto;
        width: 100%;
    }
}

/* Mode Section Styling */
.mode-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.mode-section h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.mode-section .description {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 14px;
}

.mode-radio-group {
    display: flex;
    gap: 15px;
}

.mode-radio-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    position: relative;
}

.mode-radio-option:hover {
    border-color: #007cba;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.1);
}

.mode-radio-option.selected {
    border-color: #007cba;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.15);
}

.mode-radio-option input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #ddd;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mode-radio-option.selected .radio-custom::after {
    opacity: 1;
}

/* Live Mode Radio - Green */
.live-radio {
    border-color: #28a745;
    background: #28a745;
}

.mode-radio-option.selected .live-radio {
    border-color: #28a745;
    background: #28a745;
}

/* Test Mode Radio - Orange */
.test-radio {
    border-color: #ff9500;
    background: #ff9500;
}

.mode-radio-option.selected .test-radio {
    border-color: #ff9500;
    background: #ff9500;
}

.radio-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.radio-title {
    font-weight: 600;
    font-size: 16px;
    color: #1a1a1a;
    margin: 0;
}

.radio-description {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* Credentials Section */
.credentials-section {
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.credentials-section h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.credentials-section .description {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 14px;
}

/* Currency Section */
.currency-section {
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.currency-section h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.currency-section .description {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 14px;
}

/* Debug Section */
.debug-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.debug-section h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.debug-section h4 {
    margin: 20px 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.debug-section pre {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    font-size: 12px;
    line-height: 1.4;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
}

.debug-section p {
    margin: 10px 0;
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .server-limits-recommendations {
        grid-template-columns: 1fr;
    }
    
    .gateway-header-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .accordion-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .mode-radio-group {
        flex-direction: column;
    }
    
    .mode-radio-option {
        flex: none;
    }
}

/* Page Creation Button Styles */
.page-creation-section {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
}

.page-creation-section button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.page-creation-section button:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.page-creation-section button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.page-creation-section button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.page-creation-section .description {
    margin-top: 10px;
    color: #666;
    font-size: 13px;
    line-height: 1.4;
}

.page-creation-status {
    margin-top: 15px;
}

.page-creation-status .notice {
    margin: 0;
    padding: 10px 15px;
    border-radius: 4px;
}

.page-creation-status .notice-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.page-creation-status .notice-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.page-creation-status .notice p {
    margin: 0;
    font-size: 13px;
}

/* Common Settings Save Feedback */
#common-save-result {
    margin-top: 10px;
}

#common-save-result .notice {
    margin: 0;
    padding: 12px 15px;
    border-radius: 4px;
    border-left: 4px solid;
    font-size: 14px;
    font-weight: 500;
}

#common-save-result .notice-success {
    background: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

#common-save-result .notice-error {
    background: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

#common-save-result .notice-info {
    background: #d1ecf1;
    border-left-color: #17a2b8;
    color: #0c5460;
}

#common-save-result .notice p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
}

/* Button state improvements */
#save-common-settings:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#save-common-settings:disabled:hover {
    background-color: #0073aa;
}
