/* 
 * Buttons CSS
 * Contains all button styles and variations with theme support
 */

/* Base Button Styles */
.hero .btn {
    display: inline-block;
    padding: 1.2rem 2.5rem;
    background: var(--theme-accent);
    color: var(--theme-text-primary);
    text-decoration: none;
    border-radius: var(--radius-full);
    font-weight: bold;
    font-size: var(--font-size-md);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Button Hover Effects */
.btn:hover {
    background: var(--secondary);
    color: var(--theme-text-primary);
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: var(--theme-card-border);
}

/* Active State */
.hero .btn:active {
    transform: translateY(-1px) scale(1);
    box-shadow: var(--shadow-sm);
}

/* Pulse Animation */
@keyframes buttonPulse {
    0% {
        box-shadow: 0 0 0 0 var(--theme-highlight);
    }
    70% {
        box-shadow: 0 0 0 10px transparent;
    }
    100% {
        box-shadow: 0 0 0 0 transparent;
    }
}

.hero .btn {
    animation: buttonPulse 2s infinite;
}

/* Button Sizes */
.btn-sm {
    padding: 0.8rem 1.5rem;
    font-size: var(--font-size-sm);
}

.btn-lg {
    padding: 1.5rem 3rem;
    font-size: var(--font-size-lg);
}

/* Button Variants */
.btn-primary {
    background: var(--theme-accent);
    color: var(--theme-text-primary);
}

.btn-primary:hover {
    background: var(--secondary);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--theme-text-primary);
}

.btn-secondary:hover {
    background: var(--theme-accent);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--theme-accent);
    color: var(--theme-accent);
}

.btn-outline:hover {
    background: var(--theme-accent);
    color: var(--theme-text-primary);
}

/* Ghost Button */
.btn-ghost {
    background: transparent;
    color: var(--theme-accent);
    box-shadow: none;
}

.btn-ghost:hover {
    background: var(--theme-highlight);
    box-shadow: none;
    transform: translateY(0);
}

/* Button with Shine Effect */
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        transparent,
        var(--theme-highlight),
        transparent
    );
    transform: skewX(-25deg);
    transition: 0.75s;
}

.btn:hover::before {
    animation: shine 0.75s;
}

/* Shine Animation */
@keyframes shine {
    100% {
        left: 125%;
    }
}

/* Focus State */
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--theme-highlight);
}

/* Button with Icon */
.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon svg {
    width: 1.2em;
    height: 1.2em;
    transition: transform var(--transition-normal);
}

.btn-icon:hover svg {
    transform: translateX(4px);
}

/* Loading State */
.btn-loading {
    position: relative;
    pointer-events: none;
    color: transparent;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1.2em;
    height: 1.2em;
    margin: -0.6em 0 0 -0.6em;
    border: 2px solid var(--theme-text-primary);
    border-right-color: transparent;
    border-radius: 50%;
    animation: button-loading 0.7s linear infinite;
}

@keyframes button-loading {
    to {
        transform: rotate(360deg);
    }
}

/* Disabled State */
.btn:disabled,
.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
    background: var(--theme-bg-secondary);
    color: var(--theme-text-secondary);
}

/* Button Groups */
.btn-group {
    display: inline-flex;
    gap: var(--spacing-sm);
}

.btn-group-vertical {
    display: inline-flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* Full Width Button */
.btn-block {
    display: block;
    width: 100%;
}

/* Button with Ripple Effect */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--theme-highlight);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-ripple:active::after {
    width: 200%;
    height: 200%;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .btn {
        padding: 1rem 2rem;
    }

    .btn-lg {
        padding: 1.2rem 2.5rem;
    }

    .btn-sm {
        padding: 0.6rem 1.2rem;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
    }
}

/* Focus Styles */
.btn:focus-visible {
    outline: 2px solid var(--theme-accent);
    outline-offset: 2px;
}

/* Dark Mode Specific Adjustments */
@media (prefers-color-scheme: dark) {
    .btn {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }
    
    .btn:hover {
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    }
}

/* Touch Device Optimizations */
@media (hover: none) {
    .btn:hover {
        transform: none;
    }
    
    .btn-icon:hover svg {
        transform: none;
    }
}