﻿/* 
 * Stylish Checkbox Styles (Option 2)
 * Animated Gradient Checkbox
 */

/* Main checkbox container */
.stylish-checkbox {
    margin: 0;
    padding: 0;
}

    .stylish-checkbox label {
        display: flex;
        align-items: center;
        cursor: pointer;
        user-select: none;
        transition: all 0.3s ease;
        padding: 15px;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 249, 255, 0.9) 100%);
        border-radius: 15px;
        border: 2px solid transparent;
        position: relative;
        overflow: hidden;
    }

        .stylish-checkbox label:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 30px rgba(102, 126, 234, 0.15);
            border-color: #e0e7ff;
        }

/* Checkbox container with gradient animation */
.checkbox-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .checkbox-container::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 18px;
        background: #f0f2f5;
        transition: all 0.3s ease;
        z-index: 0;
    }

/* Gradient background for checked state */
.checkbox-background {
    position: absolute;
    width: calc(100% - 4px);
    height: calc(100% - 4px);
    border-radius: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform: scale(0.8);
    z-index: 1;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

/* Checkmark icon */
.checkbox-checkmark {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: white;
    font-size: 28px;
    opacity: 0;
    transform: scale(0.5) rotate(-45deg);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 2;
}

/* Checked state styles */
.stylish-checkbox input:checked ~ label .checkbox-background {
    opacity: 1;
    transform: scale(1);
}

.stylish-checkbox input:checked ~ label .checkbox-checkmark {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* Pulsing animation for checked state */
.stylish-checkbox input:checked ~ label .checkbox-container::after {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: -1;
    opacity: 0.2;
    animation: checkboxPulse 2s infinite;
}

/* Text styling */
.checkbox-text {
    flex: 1;
    transition: all 0.3s ease;
}

    .checkbox-text .text-muted {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    /* Links styling */
    .checkbox-text a {
        color: #667eea;
        font-weight: 600;
        position: relative;
        text-decoration: none;
        transition: all 0.3s ease;
        padding-bottom: 2px;
    }

        .checkbox-text a:hover {
            color: #764ba2;
        }

        .checkbox-text a::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 0;
            height: 2px;
            background: linear-gradient(90deg, #667eea, #764ba2);
            transition: width 0.3s ease;
        }

        .checkbox-text a:hover::after {
            width: 100%;
        }

/* Hover effects */
.stylish-checkbox label:hover .checkbox-container::before {
    background: #e6e9ff;
}

.stylish-checkbox input:checked ~ label:hover .checkbox-container::after {
    animation: checkboxPulseHover 1.5s infinite;
}

/* Focus accessibility */
.stylish-checkbox input:focus-visible ~ label {
    outline: 2px solid #667eea;
    outline-offset: 4px;
    border-radius: 18px;
}

/* Pulsing animations */
@keyframes checkboxPulse {
    0%, 100% {
        opacity: 0.2;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(1.05);
    }
}

@keyframes checkboxPulseHover {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.08);
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .stylish-checkbox label {
        padding: 12px;
        border-radius: 12px;
    }

    .checkbox-container {
        width: 60px;
        height: 60px;
    }

        .checkbox-container::before {
            border-radius: 15px;
        }

    .checkbox-background {
        border-radius: 14px;
    }

    .checkbox-checkmark {
        font-size: 24px;
    }

    .checkbox-text .fw-bold {
        font-size: 1rem;
    }

    .checkbox-text .text-muted {
        font-size: 0.9rem;
    }

    .stylish-checkbox input:checked ~ label .checkbox-container::after {
        border-radius: 20px;
    }
}

@media (max-width: 576px) {
    .stylish-checkbox label {
        padding: 10px;
        flex-direction: column;
        align-items: flex-start;
        text-align: center;
    }

    .checkbox-container {
        width: 55px;
        height: 55px;
        margin: 0 auto 15px;
    }

    .checkbox-text {
        text-align: center;
        margin-left: 0 !important;
    }

    .stylish-checkbox label:hover {
        transform: translateY(-1px);
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .stylish-checkbox label {
        background: linear-gradient(135deg, rgba(30, 30, 40, 0.9) 0%, rgba(40, 40, 60, 0.9) 100%);
        border-color: #2d3748;
    }

        .stylish-checkbox label:hover {
            border-color: #4a5568;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        }

    .checkbox-container::before {
        background: #2d3748;
    }

    .stylish-checkbox label:hover .checkbox-container::before {
        background: #4a5568;
    }

    .checkbox-text .text-muted {
        color: #a0aec0;
    }
}

/* Animation for initial load */
@keyframes fadeInCheckbox {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stylish-checkbox {
    animation: fadeInCheckbox 0.6s ease-out 0.3s both;
}

    /* Success state for Continue button when checked */
    .stylish-checkbox input:checked ~ .checkbox-text {
        animation: textSuccess 0.3s ease;
    }

@keyframes textSuccess {
    0% {
        color: inherit;
    }

    50% {
        color: #667eea;
    }

    100% {
        color: inherit;
    }
}
