/**
 * Settings Page CSS for Subscription System
 *
 * @package    Subscription_System
 * @subpackage Subscription_System/admin/css
 */

.subscription-system-settings {
    max-width: none;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    margin-right: 20px;
}

/* Hide default WordPress form tables */
.subscription-system-settings .form-table {
    display: none !important;
}

.subscription-system-settings h2 {
    display: none !important;
}

/* Settings Header */
.settings-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 40px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.settings-header-content h1 {
    margin: 0 0 10px 0;
    font-size: 32px;
    color: white;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.settings-description {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
    line-height: 1.4;
}

.settings-icon .dashicons {
    font-size: 60px;
    opacity: 0.8;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Settings Container */
.settings-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid #e1e5e9;
    overflow: hidden;
}

/* Settings Sections */
.settings-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.settings-section:last-child {
    border-bottom: none;
}

.section-header {
    background: #f8f9fa;
    padding: 25px 30px;
    border-bottom: 1px solid #e9ecef;
}

.section-header h2 {
    margin: 0 0 8px 0;
    color: #23282d;
    font-size: 20px;
    font-weight: 600;
    display: block !important;
}

.section-header p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* Settings Fields */
.settings-fields {
    padding: 30px;
}

/* Field Groups */
.field-group {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.field-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

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

.field-label {
    font-size: 16px;
    font-weight: 600;
    color: #23282d;
    margin-bottom: 5px;
    display: block;
}

.field-description {
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

.field-control {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Toggle Switch Styles - Fixed Version */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    margin-right: 15px;
}

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

.toggle-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
    display: block;
}

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

/* When checkbox is checked */
.toggle-input:checked + .toggle-label {
    background-color: #0073aa;
}

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

/* Focus state */
.toggle-input:focus + .toggle-label {
    box-shadow: 0 0 1px #0073aa;
}

/* Active class for JavaScript control */
.toggle-switch.active .toggle-label {
    background-color: #0073aa;
}

.toggle-switch.active .toggle-label:before {
    transform: translateX(26px);
}

/* Hover effects */
.toggle-label:hover {
    background-color: #999;
}

.toggle-input:checked + .toggle-label:hover,
.toggle-switch.active .toggle-label:hover {
    background-color: #005a87;
}

/* Toggle text styling */
.toggle-text {
    font-weight: 600;
    font-size: 14px;
    color: #666;
    transition: color 0.3s ease;
    min-width: 70px;
}

.toggle-switch.active + .toggle-text {
    color: #0073aa;
}

/* Radio Groups */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 0;
}

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

.radio-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 50%;
    position: relative;
    transition: all 0.2s ease;
}

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

.radio-option input[type="radio"]:checked + .radio-custom {
    border-color: #0073aa;
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
    transform: translate(-50%, -50%) scale(1);
}

.radio-label {
    font-size: 14px;
    color: #555;
}

/* Select Fields */
.select-field {
    min-width: 200px;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s ease;
}

.select-field:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}

/* Settings Actions */
.settings-actions {
    background: #f8f9fa;
    padding: 25px 30px;
    border-top: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 15px;
}

.button-save {
    background: #0073aa !important;
    border-color: #0073aa !important;
    color: white !important;
    padding: 12px 24px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(0,115,170,0.3) !important;
}

.button-save:hover {
    background: #005a87 !important;
    border-color: #005a87 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0,115,170,0.4) !important;
}

.button-save:disabled {
    opacity: 0.6 !important;
    transform: none !important;
    cursor: not-allowed !important;
}

.button-reset {
    padding: 12px 20px;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.button-reset:hover {
    background: #f0f0f1;
    transform: translateY(-1px);
}

/* Settings Sidebar */
.settings-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: 1px solid #e1e5e9;
    padding: 25px;
}

.sidebar-section h3 {
    margin: 0 0 20px 0;
    color: #23282d;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.help-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.help-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.help-item .dashicons {
    color: #0073aa;
    font-size: 20px;
    margin-top: 2px;
    flex-shrink: 0;
}

.help-item strong {
    display: block;
    color: #23282d;
    font-size: 14px;
    margin-bottom: 5px;
}

.help-item p {
    margin: 0;
    color: #666;
    font-size: 13px;
    line-height: 1.4;
}

.help-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.help-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    text-decoration: none;
    color: #0073aa;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.help-link:hover {
    background: #e9ecef;
    border-color: #0073aa;
    color: #005a87;
    text-decoration: none;
    transform: translateY(-1px);
}

.help-link .dashicons {
    font-size: 16px;
    flex-shrink: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .subscription-system-settings {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-right: 0;
    }
    
    .settings-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
        padding: 25px 20px;
    }
    
    .settings-header-content h1 {
        font-size: 24px;
    }
    
    .field-group {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .field-header {
        padding-right: 0;
    }
    
    .settings-fields {
        padding: 20px;
    }
    
    .section-header {
        padding: 20px;
    }
    
    .settings-actions {
        padding: 20px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .settings-actions .button {
        text-align: center;
    }
    
    .sidebar-section {
        padding: 20px;
    }
}

/* Success/Error Messages */
.notice {
    margin: 20px 0;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.notice.notice-success {
    border-left-color: #46b450;
    background: #f7fff7;
}

.notice.notice-error {
    border-left-color: #dc3232;
    background: #fff7f7;
}

/* Loading States */
.settings-container.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.settings-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Copy shortcode button styles */
.copy-shortcode {
    transition: all 0.3s ease;
}

.copy-shortcode.copied {
    background-color: #46b450 !important;
    transform: scale(1.1);
}

.copy-shortcode.copied .dashicons {
    animation: checkmark 0.3s ease;
}

@keyframes checkmark {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
} 