/**
 * Toggle Component Styles
 *
 * Reusable toggle switch component with:
 * - Smooth animations
 * - Accessible design
 * - Multiple states (on/off)
 * - Icon support
 * - Mobile-responsive
 * - Clean, modern design
 *
 * NOTE: This component uses the centralized color management system from src/color-system/colors.css
 * All colors are referenced using CSS custom properties (variables) for consistency.
 *
 * @author Austin Steil
 * @version 1.0.0
 * @license MIT <https://raw.githubusercontent.com/AustinSteil/generate-files-model/refs/heads/main/LICENSE>
 * @copyright 2025 Austin Steil
 * @created October 18, 2025
 * @updated October 18, 2025
 */

/* Base Toggle Container */
.toggle-container {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-md);
    cursor: pointer;
    user-select: none;
}

/* Toggle Label */
.toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-primary);
    transition: color var(--transition-base);
}

/* Toggle Switch Track */
.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    background: var(--color-gray-300);
    border-radius: var(--radius-full);
    transition: background var(--transition-base);
    cursor: pointer;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Toggle Switch Thumb */
.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background: var(--color-bg-primary);
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* Toggle Active State */
.toggle-switch.active {
    background: var(--gradient-success-solid);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active .toggle-thumb {
    transform: translateX(24px);
}

/* Toggle Icons */
.toggle-icon {
    font-size: 12px;
    line-height: 1;
}

.toggle-icon-off {
    display: block;
}

.toggle-icon-on {
    display: none;
}

.toggle-switch.active .toggle-icon-off {
    display: none;
}

.toggle-switch.active .toggle-icon-on {
    display: block;
}

/* Hover State */
.toggle-container:hover .toggle-switch {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 0 0 3px rgba(var(--color-primary-rgb), var(--opacity-10));
}

.toggle-container:hover .toggle-label {
    color: var(--color-primary);
}

/* Focus State for Accessibility */
.toggle-container:focus-within .toggle-switch {
    outline: 2px solid var(--color-info);
    outline-offset: 2px;
}

/* Disabled State */
.toggle-container.disabled {
    opacity: var(--opacity-50);
    cursor: not-allowed;
    pointer-events: none;
}

/* Hidden Checkbox (for accessibility) */
.toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .toggle-switch,
    .toggle-thumb,
    .toggle-label {
        transition: none;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .toggle-switch {
        width: 48px;
        height: 26px;
    }

    .toggle-thumb {
        width: 22px;
        height: 22px;
    }

    .toggle-switch.active .toggle-thumb {
        transform: translateX(22px);
    }

    .toggle-label {
        font-size: 13px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .toggle-switch {
        border: 2px solid var(--color-text-primary);
    }

    .toggle-thumb {
        border: 2px solid var(--color-text-primary);
    }
}

