/**
 * SecureHold Frontend & Appearance Tab Styles - COMPLET
 * Version: 3.8.1
 */

.sh-frontend-wrapper {
    margin-top: 2rem;
}

/* ============================================
   FORM ELEMENTS - BASE
   ============================================ */

/* Labels */
.sh-label {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.sh-required {
    color: #ef4444;
    margin-left: 0.25rem;
}

.sh-help-text {
    display: block;
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
    line-height: 1.5;
}

/* Input fields */
.sh-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9375rem;
    color: #1f2937;
    background: white;
    transition: all 0.2s;
}

.sh-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.sh-input:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

.sh-input::placeholder {
    color: #9ca3af;
}

/* Textarea */
.sh-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9375rem;
    color: #1f2937;
    background: white;
    transition: all 0.2s;
    resize: vertical;
    font-family: inherit;
    line-height: 1.6;
}

.sh-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Select dropdowns */
.sh-select {
    width: 100%;
    padding: 0.625rem 2.5rem 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9375rem;
    color: #1f2937;
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
    background-size: 12px;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s;
}

.sh-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.sh-select:disabled {
    background-color: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

/* Form groups */
.sh-form-group {
    margin-bottom: 1.5rem;
}

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

/* ============================================
   BUTTONS
   ============================================ */

.sh-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.sh-button .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Primary button */
.sh-button-primary {
    background: #2563eb;
    color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sh-button-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.sh-button-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Secondary button */
.sh-button-secondary {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.sh-button-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.sh-button-secondary:active {
    background: #f3f4f6;
}

/* Button sizes */
.sh-button-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.875rem;
}

.sh-button-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

/* ============================================
   CARDS
   ============================================ */

.sh-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.sh-card-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.sh-card-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.sh-card-title .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #2563eb;
}

.sh-card-description {
    margin: 0.5rem 0 0 0;
    font-size: 0.9375rem;
    color: #6b7280;
    line-height: 1.6;
}

.sh-card-body {
    padding: 1.5rem;
}

/* ============================================
   ALERTS
   ============================================ */

.sh-alert {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 6px;
    border-left: 4px solid;
}

.sh-alert .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.sh-alert strong {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.sh-alert p {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.5;
}

/* Alert variants */
.sh-alert-info {
    background: #eff6ff;
    border-color: #2563eb;
    color: #1e40af;
}

.sh-alert-info .dashicons {
    color: #2563eb;
}

.sh-alert-success {
    background: #f0fdf4;
    border-color: #10b981;
    color: #065f46;
}

.sh-alert-success .dashicons {
    color: #10b981;
}

.sh-alert-warning {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}

.sh-alert-warning .dashicons {
    color: #f59e0b;
}

.sh-alert-danger {
    background: #fef2f2;
    border-color: #ef4444;
    color: #991b1b;
}

.sh-alert-danger .dashicons {
    color: #ef4444;
}

/* ============================================
   VARIABLES PANEL
   ============================================ */
.sh-variables-panel {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.sh-variables-panel h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1f2937;
}

.sh-variables-category {
    margin-top: 1.5rem;
}

.sh-variables-category:first-child {
    margin-top: 1rem;
}

.sh-variables-category h5 {
    margin: 0 0 0.75rem 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sh-variables-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sh-variables-list li {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sh-variable {
    display: inline-block;
    background: white;
    border: 1px solid #d1d5db;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.8125rem;
    color: #2563eb;
    cursor: pointer;
    transition: all 0.2s;
    width: fit-content;
}

.sh-variable:hover {
    background: #eff6ff;
    border-color: #2563eb;
    transform: translateY(-1px);
}

.sh-variable-desc {
    font-size: 0.8125rem;
    color: #6b7280;
    padding-left: 0.25rem;
}

/* ============================================
   MESSAGE PREVIEW
   ============================================ */
.sh-message-preview {
    border: 2px dashed #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    background: #fafafa;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sh-preview-note {
    color: #9ca3af;
    text-align: center;
    font-style: italic;
    font-size: 0.9375rem;
}

/* ============================================
   SHORTCODES
   ============================================ */
.sh-shortcode-item {
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: white;
}

.sh-shortcode-item:last-child {
    margin-bottom: 0;
}

.sh-shortcode-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.sh-shortcode-code {
    background: #1f2937;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.025em;
}

.sh-shortcode-description {
    color: #6b7280;
    margin: 0 0 1rem 0;
    line-height: 1.6;
}

.sh-shortcode-example {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 6px;
    border-left: 3px solid #2563eb;
}

.sh-shortcode-example strong {
    color: #1f2937;
    display: block;
    margin-bottom: 0.5rem;
}

.sh-shortcode-example p,
.sh-shortcode-example ul {
    margin: 0;
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.6;
}

.sh-shortcode-example ul {
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

.sh-copy-shortcode {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
    position: relative;
    overflow: hidden;
}

.sh-copy-shortcode::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.sh-copy-shortcode:hover::before {
    left: 100%;
}

.sh-copy-shortcode:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.sh-copy-shortcode:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.sh-copy-shortcode .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* ============================================
   TOGGLE IMPROVEMENTS
   ============================================ */
.sh-toggle-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    cursor: pointer;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s;
    background: white;
}

.sh-toggle-wrapper:hover {
    border-color: #2563eb;
    background: #f9fafb;
}

.sh-toggle-wrapper input[type="checkbox"] {
    display: none;
}

.sh-toggle-slider {
    width: 48px;
    height: 26px;
    background: #d1d5db;
    border-radius: 13px;
    position: relative;
    transition: background 0.3s;
    flex-shrink: 0;
}

/* Désactiver tous les pseudo-éléments par défaut */
.sh-toggle-slider::before,
.sh-toggle-slider::after {
    content: none !important;
    display: none !important;
}

/* SEUL cercle blanc qui doit exister */
.sh-toggle-slider::before {
    content: '' !important;
    display: block !important;
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    top: 3px;
    left: 3px;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.sh-toggle-wrapper input:checked + .sh-toggle-slider {
    background: #10b981;
}

.sh-toggle-wrapper input:checked + .sh-toggle-slider::before {
    transform: translateX(22px);
}

.sh-toggle-label {
    flex: 1;
}

.sh-toggle-label strong {
    display: block;
    color: #1f2937;
    margin-bottom: 0.25rem;
    font-size: 0.9375rem;
}

.sh-toggle-label .sh-help-text {
    display: block;
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: normal;
    line-height: 1.5;
}

/* ============================================
   FORM ROWS
   ============================================ */
.sh-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .sh-form-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.sh-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #1f2937;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    z-index: 99999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    font-size: 0.9375rem;
    font-weight: 500;
}

.sh-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .sh-card-header {
        padding: 1.25rem;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .sh-card-body {
        padding: 1.25rem;
    }
    
    .sh-shortcode-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .sh-shortcode-code {
        font-size: 0.8125rem;
        padding: 0.375rem 0.75rem;
    }
}
