/**
 * Copyright since 2026 Prestachamps
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License version 3.0
 * that is bundled with this package in the file LICENSE.md.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/AFL-3.0
 *
 * Clean URLs Module - Admin Configuration Styles.
 *
 * @author    Prestachamps <support@prestachamps.com>
 * @copyright 2026 Prestachamps
 * @license   https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
 */

.pchcleanurl-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Header */
.pchcleanurl-header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    border-radius: 8px 8px 0 0;
    padding: 24px 30px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pchcleanurl-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: #fff;
}

.pchcleanurl-header .header-subtitle {
    margin: 4px 0 0;
    font-size: 13px;
    opacity: 0.85;
}

.pchcleanurl-header .version-badge {
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Alert */
.pchcleanurl-alert {
    padding: 12px 20px;
    border-radius: 0;
    font-size: 14px;
    border-left: 4px solid;
}

.pchcleanurl-alert.success {
    background: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

/* Tab Navigation */
.pchcleanurl-tab-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.pchcleanurl-tab-nav li {
    padding: 14px 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #6c757d;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pchcleanurl-tab-nav li:hover {
    color: #3498db;
    background: rgba(52, 152, 219, 0.05);
}

.pchcleanurl-tab-nav li.active {
    color: #3498db;
    border-bottom-color: #3498db;
    background: #fff;
}

.pchcleanurl-tab-nav li .tab-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Tab Content */
.pchcleanurl-tab-content {
    background: #fff;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.pchcleanurl-tab-panel {
    display: none;
    padding: 30px;
}

.pchcleanurl-tab-panel.active {
    display: block;
}

/* Section Title */
.pchcleanurl-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* Setting Row */
.pchcleanurl-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
}

.pchcleanurl-setting-row:last-child {
    border-bottom: none;
}

.setting-label {
    flex: 1;
    padding-right: 20px;
}

.setting-label strong {
    font-size: 14px;
    color: #2c3e50;
    display: block;
    margin-bottom: 3px;
}

.setting-label .setting-desc {
    font-size: 12px;
    color: #95a5a6;
    margin: 0;
    line-height: 1.4;
}

/* Toggle Switch — use !important to override PrestaShop admin Bootstrap styles */
.pchcleanurl-wrapper .pchcleanurl-switch {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    cursor: pointer !important;
    gap: 8px !important;
    user-select: none;
    margin-bottom: 0 !important;
    padding-left: 0 !important;
}

.pchcleanurl-wrapper .pchcleanurl-switch input[type="checkbox"] {
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    position: absolute !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.pchcleanurl-wrapper .pchcleanurl-switch input[type="checkbox"] + .switch-slider {
    width: 48px !important;
    height: 26px !important;
    background: #ccd1d9 !important;
    border-radius: 13px !important;
    position: relative !important;
    transition: background 0.3s ease !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
    vertical-align: middle !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer !important;
}

.pchcleanurl-wrapper .pchcleanurl-switch input[type="checkbox"] + .switch-slider::before {
    display: none !important;
}

.pchcleanurl-wrapper .pchcleanurl-switch input[type="checkbox"] + .switch-slider::after {
    content: '' !important;
    width: 22px !important;
    height: 22px !important;
    background: #fff !important;
    border-radius: 50% !important;
    position: absolute !important;
    top: 2px !important;
    left: 2px !important;
    transition: transform 0.3s ease !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2) !important;
    display: block !important;
}

.pchcleanurl-wrapper .pchcleanurl-switch input[type="checkbox"]:checked + .switch-slider {
    background: #27ae60 !important;
}

.pchcleanurl-wrapper .pchcleanurl-switch input[type="checkbox"]:checked + .switch-slider::after {
    transform: translateX(22px) !important;
}

.pchcleanurl-wrapper .switch-status {
    font-size: 12px !important;
    font-weight: 600 !important;
    min-width: 28px !important;
    display: inline-block !important;
}

.pchcleanurl-wrapper .pchcleanurl-switch input[type="checkbox"]:checked ~ .switch-status {
    color: #27ae60 !important;
}

.pchcleanurl-wrapper .pchcleanurl-switch input[type="checkbox"]:not(:checked) ~ .switch-status {
    color: #95a5a6 !important;
}

/* Info Box */
.pchcleanurl-info-box {
    background: #f0f7ff;
    border: 1px solid #d0e3f7;
    border-radius: 6px;
    padding: 16px 20px;
    margin-top: 20px;
}

.pchcleanurl-info-box .info-title {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pchcleanurl-info-box .info-title .info-icon {
    color: #3498db;
    font-size: 16px;
}

.url-comparison {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.url-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.url-label {
    font-weight: 600;
    min-width: 90px;
    flex-shrink: 0;
}

.url-label.old {
    color: #e74c3c;
}

.url-label.new {
    color: #27ae60;
}

.url-value {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    background: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    font-size: 12px;
    color: #555;
    flex: 1;
    overflow-x: auto;
}

.url-value .id-highlight {
    color: #e74c3c;
    font-weight: 700;
    text-decoration: line-through;
}

/* General Tab - Status Grid */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.status-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: border-color 0.2s;
}

.status-card.enabled {
    border-left: 3px solid #27ae60;
}

.status-card.disabled {
    border-left: 3px solid #e74c3c;
    opacity: 0.7;
}

.status-card .status-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.status-card.enabled .status-icon {
    background: #d4edda;
    color: #27ae60;
}

.status-card.disabled .status-icon {
    background: #f8d7da;
    color: #e74c3c;
}

.status-card .status-text {
    flex: 1;
}

.status-card .status-text strong {
    font-size: 13px;
    color: #2c3e50;
    display: block;
}

.status-card .status-text span {
    font-size: 11px;
    color: #95a5a6;
}

/* General Tab - Welcome Box */
.pchcleanurl-welcome {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.pchcleanurl-welcome h3 {
    margin: 0 0 8px;
    font-size: 18px;
    color: #2c3e50;
}

.pchcleanurl-welcome p {
    margin: 0;
    font-size: 14px;
    color: #5a6c7d;
    line-height: 1.6;
}

/* Settings Card */
.pchcleanurl-settings-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 20px 24px;
    margin-bottom: 20px;
}

.pchcleanurl-settings-card .card-title {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

/* Route Prefix Input */
.pchcleanurl-prefix-input {
    display: flex;
    align-items: center;
    gap: 0;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 13px;
}

.pchcleanurl-prefix-input .prefix-domain {
    background: #e9ecef;
    color: #6c757d;
    padding: 8px 10px;
    border: 1px solid #ced4da;
    border-right: none;
    border-radius: 4px 0 0 4px;
    white-space: nowrap;
    font-size: 12px;
}

.pchcleanurl-wrapper .pchcleanurl-text-input {
    border: 1px solid #ced4da !important;
    border-radius: 0 !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace !important;
    color: #2c3e50 !important;
    background: #fff !important;
    min-width: 120px !important;
    max-width: 200px !important;
    outline: none !important;
    transition: border-color 0.2s ease !important;
    height: auto !important;
    line-height: normal !important;
    box-shadow: none !important;
}

.pchcleanurl-wrapper .pchcleanurl-text-input:focus {
    border-color: #3498db !important;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.15) !important;
}

.pchcleanurl-prefix-input .prefix-suffix {
    background: #e9ecef;
    color: #6c757d;
    padding: 8px 10px;
    border: 1px solid #ced4da;
    border-left: none;
    border-radius: 0 4px 4px 0;
    white-space: nowrap;
    font-size: 12px;
}

/* Footer / Save Button */
.pchcleanurl-footer {
    padding: 20px 30px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
    text-align: right;
}

.pchcleanurl-btn-save {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #fff;
    border: none;
    padding: 12px 32px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
}

.pchcleanurl-btn-save:hover {
    background: linear-gradient(135deg, #2980b9 0%, #2471a3 100%);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
    transform: translateY(-1px);
}

.pchcleanurl-btn-save:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(52, 152, 219, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .pchcleanurl-tab-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .pchcleanurl-tab-nav li {
        padding: 12px 14px;
        font-size: 12px;
    }

    .pchcleanurl-setting-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .setting-label {
        padding-right: 0;
    }

    .status-grid {
        grid-template-columns: 1fr;
    }

    .url-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}
