/*
 * Global Animation & Effects Stylesheet
 * Consistent animations across all components
 */

/* =====================================================
   SPRING ANIMATION EASING
   ===================================================== */
:root {
    --spring-easing: cubic-bezier(0.34, 1.56, 0.64, 1);
    --smooth-easing: cubic-bezier(0.4, 0, 0.2, 1);
    --primary-purple: #8B5CF6;
    --primary-pink: #EC4899;
    --glow-color: rgba(139, 92, 246, 0.6);
}

/* =====================================================
   BUTTON STYLES
   ===================================================== */
.btn-animated,
button.animated,
.button-animated {
    transition: all 0.4s var(--spring-easing),
                transform 0.2s var(--spring-easing);
    position: relative;
}

.btn-animated:hover,
button.animated:hover,
.button-animated:hover {
    transform: translateY(-2px);
    /* Remove glow; shadow handled in button theme */
    box-shadow: none;
}

.btn-animated:active,
button.animated:active,
.button-animated:active {
    transform: scale(0.95);
}

/* Primary Button - Gradient */
.btn-primary-gradient {
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-pink));
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.btn-primary-gradient:hover {
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

/* Secondary Button - Glassmorphism */
.btn-secondary-glass {
    background: rgba(139, 92, 246, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: white;
}

.btn-secondary-glass:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

/* =====================================================
   NAV/MENU ITEMS
   ===================================================== */
.nav-item-animated,
.menu-item-animated {
    transition: all 0.4s var(--spring-easing),
                transform 0.2s var(--spring-easing);
    position: relative;
}

.nav-item-animated::before,
.menu-item-animated::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--primary-purple), var(--primary-pink));
    transition: height 0.4s var(--spring-easing);
    border-radius: 0 2px 2px 0;
}

.nav-item-animated:hover,
.menu-item-animated:hover {
    background: rgba(139, 92, 246, 0.12);
    backdrop-filter: blur(10px);
    transform: translateX(4px);
    /* Soften nav glow into neutral shadow */
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.nav-item-animated.active::before,
.menu-item-animated.active::before {
    height: 60%;
}

.nav-item-animated.active,
.menu-item-animated.active {
    background: rgba(139, 92, 246, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(139, 92, 246, 0.3);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1);
}

/* =====================================================
   ICON ANIMATIONS
   ===================================================== */
.icon-animated {
    transition: all 0.3s var(--spring-easing);
}

.icon-animated:hover {
    transform: scale(1.15);
    filter: drop-shadow(0 0 8px var(--glow-color));
}

.nav-item-animated:hover .icon-animated,
.menu-item-animated:hover .icon-animated,
.btn-animated:hover .icon-animated {
    transform: scale(1.1);
    /* Remove icon glow on hover for buttons/nav */
    filter: none;
}

.nav-item-animated.active .icon-animated,
.menu-item-animated.active .icon-animated {
    filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.8));
}

/* =====================================================
   SLIDER/RANGE INPUTS
   ===================================================== */
input[type="range"].slider-animated {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #1F1F23;
    border-radius: 10px;
    outline: none;
    transition: all 0.4s var(--spring-easing);
    cursor: pointer;
}

input[type="range"].slider-animated:hover {
    background: #25252b;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
}

input[type="range"].slider-animated::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-pink));
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s var(--spring-easing);
    border: 2px solid #0F0F12;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

input[type="range"].slider-animated::-webkit-slider-thumb:hover {
    transform: scale(1.3);
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.8);
}

input[type="range"].slider-animated::-webkit-slider-thumb:active {
    transform: scale(1.5);
    box-shadow: 0 0 20px rgba(139, 92, 246, 1);
}

input[type="range"].slider-animated::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-pink));
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s var(--spring-easing);
    border: 2px solid #0F0F12;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

input[type="range"].slider-animated::-moz-range-thumb:hover {
    transform: scale(1.3);
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.8);
}

input[type="range"].slider-animated::-moz-range-thumb:active {
    transform: scale(1.5);
    box-shadow: 0 0 20px rgba(139, 92, 246, 1);
}

/* =====================================================
   INPUT FIELDS
   ===================================================== */
input.input-animated,
select.input-animated,
textarea.input-animated {
    transition: all 0.4s var(--spring-easing);
}

input.input-animated:hover,
select.input-animated:hover,
textarea.input-animated:hover {
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.2);
}

input.input-animated:focus,
select.input-animated:focus,
textarea.input-animated:focus {
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
    background: rgba(139, 92, 246, 0.05);
}

/* =====================================================
   COLLAPSIBLE/ACCORDION
   ===================================================== */
.collapsible-header {
    transition: all 0.4s var(--spring-easing),
                transform 0.2s var(--spring-easing);
    cursor: pointer;
}

.collapsible-header:hover {
    background: rgba(139, 92, 246, 0.15);
    backdrop-filter: blur(10px);
    transform: translateX(4px);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.collapsible-header .chevron,
.collapsible-header .arrow {
    transition: transform 0.4s var(--spring-easing);
}

.collapsible-header.expanded .chevron,
.collapsible-header.expanded .arrow {
    transform: rotate(90deg);
}

.collapsible-content {
    transition: max-height 0.4s var(--smooth-easing),
                opacity 0.3s var(--smooth-easing);
    overflow: hidden;
}

/* =====================================================
   TOGGLE BUTTONS
   ===================================================== */
.toggle-btn-group button {
    transition: all 0.4s var(--spring-easing),
                transform 0.2s var(--spring-easing);
}

.toggle-btn-group button.active {
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-pink));
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.toggle-btn-group button:hover:not(.active) {
    background: rgba(139, 92, 246, 0.15);
    backdrop-filter: blur(10px);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

/* =====================================================
   CARDS
   ===================================================== */
.card-animated {
    transition: all 0.4s var(--spring-easing),
                transform 0.2s var(--spring-easing);
}

.card-animated:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.5);
}

/* =====================================================
   TOOLTIPS
   ===================================================== */
.tooltip-animated {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s var(--smooth-easing),
                visibility 0.3s var(--smooth-easing),
                transform 0.3s var(--spring-easing);
    transform: translateX(-8px);
}

.has-tooltip:hover .tooltip-animated {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* =====================================================
   MODAL/DIALOG ANIMATIONS
   ===================================================== */
.modal-animated {
    animation: modalFadeIn 0.3s var(--spring-easing);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-animated.closing {
    animation: modalFadeOut 0.3s var(--spring-easing);
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
}

/* =====================================================
   DELETE BUTTONS (Red variant)
   ===================================================== */
.btn-delete {
    color: #f87171;
    transition: all 0.4s var(--spring-easing),
                transform 0.2s var(--spring-easing);
}

.btn-delete:hover {
    background: #DC2626;
    border-color: #DC2626;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

/* =====================================================
   UTILITY CLASSES
   ===================================================== */
.glassmorphism {
    background: rgba(139, 92, 246, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.gradient-text {
    background: linear-gradient(to right, var(--primary-purple), var(--primary-pink));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.glow-purple {
    box-shadow: 0 0 20px var(--glow-color);
}

.spring-transition {
    transition: all 0.4s var(--spring-easing);
}

.smooth-transition {
    transition: all 0.3s var(--smooth-easing);
}
