/**
 * Aicoso Wishlist Settings Page Styles
 * Modern card-based design with toggle switches
 */

/* Prevent horizontal scroll on settings pages */
.aicoso-wishlist-admin {
    overflow-x: hidden !important;
    max-width: 100% !important;
}

.aicoso-admin-container {
    overflow-x: hidden !important;
    max-width: 100% !important;
}

.aicoso-main-content {
    overflow-x: hidden !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

.aicoso-settings-page {
    background: transparent;
    overflow-x: hidden;
    max-width: 100%;
}

/* Settings Header */
.aicoso-settings-header {
    margin-bottom: 30px;
}

.aicoso-settings-header h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.5px;
}

.aicoso-settings-header .description {
    color: #64748b;
    font-size: 15px;
    margin: 0;
}

/* Settings Tabs */
.aicoso-settings-tabs {
    display: flex;
    gap: 35px;
    margin-bottom: 35px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 2px;
}

/* Settings Form */
.aicoso-settings-form {
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.aicoso-settings-content {
    padding: 30px;
}

/* Settings Section */
.aicoso-settings-section {
    margin-bottom: 40px;
}

.aicoso-settings-section h2 {
    margin: 0 0 25px 0;
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.5px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

/* Settings Group */
.aicoso-settings-group {
    background: rgba(249, 250, 251, 0.5);
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #e5e7eb;
}

/* Setting Row */
.aicoso-setting-row {
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.aicoso-setting-row:last-child {
    margin-bottom: 0;
}

.aicoso-setting-row > label:first-child {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    margin-bottom: 5px;
}

.aicoso-setting-row input[type="text"],
.aicoso-setting-row input[type="email"],
.aicoso-setting-row input[type="number"],
.aicoso-setting-row select,
.aicoso-setting-row textarea {
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fff;
    max-width: 400px;
}

.aicoso-setting-row input[type="text"]:focus,
.aicoso-setting-row input[type="email"]:focus,
.aicoso-setting-row input[type="number"]:focus,
.aicoso-setting-row select:focus,
.aicoso-setting-row textarea:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.aicoso-setting-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
}

.aicoso-setting-row label input[type="checkbox"] {
    vertical-align: middle;
}

.aicoso-setting-row label span {
    vertical-align: middle;
    font-weight: 600;
    color: #374151;
}

.aicoso-setting-row .description {
    color: #6b7280;
    font-size: 13px;
    margin: 5px 0 0 0;
    line-height: 1.5;
}

/* Checkbox Group */
.aicoso-checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
}

.aicoso-checkbox-group label {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #4b5563;
    cursor: pointer;
    transition: color 0.2s;
}

.aicoso-checkbox-group label:hover {
    color: #111827;
}

.aicoso-checkbox-group input[type="checkbox"] {
    margin-right: 8px;
}

/* Regular Text Input */
.regular-text {
    width: 100%;
    max-width: 400px;
}

.large-text {
    width: 100%;
    max-width: 600px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.code {
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    background: #1e293b;
    color: #10b981;
    padding: 15px;
    border-radius: 8px;
}

/* Settings Footer */
.aicoso-settings-footer {
    padding: 20px 30px;
    background: linear-gradient(90deg, rgba(249, 250, 251, 0.9) 0%, rgba(243, 244, 246, 0.9) 100%);
    border-top: 1px solid #e5e7eb;
    border-radius: 0 0 16px 16px;
    display: flex;
    gap: 15px;
}

.aicoso-settings-footer .button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.aicoso-settings-footer .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.aicoso-btn-secondary {
    background: #fff !important;
    color: #6b7280 !important;
    border: 2px solid #e5e7eb !important;
}

.aicoso-btn-secondary:hover {
    background: #f9fafb !important;
    color: #374151 !important;
    border-color: #d1d5db !important;
    transform: translateY(-1px);
}

/* Success Notice */
.aicoso-settings-page .notice {
    margin: 20px 0;
    border-radius: 8px;
}

.aicoso-settings-page .notice-success {
    background: linear-gradient(135deg, rgba(34, 211, 153, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
    border-left: 4px solid #10b981;
}

/* Responsive */
@media (max-width: 768px) {
    .aicoso-settings-form {
        border-radius: 8px;
    }
    
    .aicoso-settings-content {
        padding: 20px;
    }
    
    .aicoso-checkbox-group {
        grid-template-columns: 1fr;
    }
    
    .aicoso-setting-row input[type="text"],
    .aicoso-setting-row input[type="email"],
    .aicoso-setting-row input[type="number"],
    .aicoso-setting-row select,
    .aicoso-setting-row textarea {
        max-width: 100%;
    }
}

/* Select Enhanced */
select {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="%236b7280"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    padding-right: 40px !important;
    appearance: none;
}

/* Loading State */
.aicoso-settings-form.loading {
    opacity: 0.6;
    pointer-events: none;
}

.aicoso-settings-form.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-radius: 50%;
    border-top: 4px solid #6366f1;
    animation: spin 1s linear infinite;
}

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

/* Settings Cards Layout */
.aicoso-settings-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Setting Card */
.aicoso-setting-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.aicoso-setting-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.aicoso-setting-card-content {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aicoso-setting-card-left {
    flex: 1;
    padding-right: 20px;
}

.aicoso-setting-card-left h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.aicoso-setting-card-left .description {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
}

.aicoso-setting-card-right {
    display: flex;
    align-items: center;
}

.aicoso-setting-card-footer {
    padding: 16px 24px;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Toggle Switch */
.aicoso-toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

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

.aicoso-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 34px;
}

.aicoso-toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.aicoso-toggle-switch input:checked + .aicoso-toggle-slider {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.aicoso-toggle-switch input:focus + .aicoso-toggle-slider {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

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

.aicoso-toggle-switch.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.aicoso-toggle-switch.disabled .aicoso-toggle-slider {
    background-color: #e5e7eb;
}

/* Configure Link */
.aicoso-configure-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #6366f1;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.aicoso-configure-link:hover {
    color: #4f46e5;
    transform: translateX(2px);
}

.aicoso-configure-link .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.aicoso-configure-link.disabled {
    color: #9ca3af;
    pointer-events: none;
}

/* PRO Badge */
.aicoso-pro-badge {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Modal Styles */
.aicoso-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.aicoso-modal-content {
    position: relative;
    background: #fff;
    margin: 5% auto;
    padding: 0;
    width: 90%;
    max-width: 600px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.aicoso-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.aicoso-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.aicoso-modal-close:hover {
    background: #f3f4f6;
    color: #1e293b;
}

.aicoso-modal-body {
    padding: 24px;
}

.aicoso-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f8fafc;
    border-radius: 0 0 16px 16px;
}

/* Enhanced Setting Row for Better Layout */
.aicoso-setting-row.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.aicoso-setting-row.toggle-row:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.aicoso-setting-row.toggle-row .setting-info {
    flex: 1;
    padding-right: 20px;
}

.aicoso-setting-row.toggle-row .setting-info label {
    display: block;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
    font-size: 15px;
}

.aicoso-setting-row.toggle-row .setting-info .description {
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

/* Animations */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}