﻿/* ========================================
   REDIRECTOR ENHANCED STYLES
   Global styles for enhanced UI interactions
   ======================================== */

/* ===== 1. CSS VARIABLES & THEME ===== */
:root {
    /* Animation Timing */
    --animation-fast: 200ms;
    --animation-normal: 300ms;
    --animation-slow: 500ms;
    --animation-very-slow: 800ms;
    /* Easing Functions */
    --easing-default: cubic-bezier(0.4, 0, 0.2, 1);
    --easing-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --easing-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --easing-elastic: cubic-bezier(0.68, -0.6, 0.32, 1.6);
    /* Shadow Elevations */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    /* Colors */
    --accent-primary: #3b82f6;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-info: #6366f1;
    /* Transitions */
    --transition-base: all var(--animation-normal) var(--easing-default);
    --transition-fast: all var(--animation-fast) var(--easing-default);
    --transition-smooth: all var(--animation-slow) var(--easing-smooth);
}

/* ===== 2. KEYFRAME ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    100% {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes breathe {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes numberFlip {
    0% {
        transform: rotateX(0deg);
    }

    50% {
        transform: rotateX(90deg);
    }

    100% {
        transform: rotateX(0deg);
    }
}

@keyframes drawCircle {
    from {
        stroke-dashoffset: 440;
    }

    to {
        stroke-dashoffset: 0;
    }
}

/* ===== 3. ENHANCED DATAGRID ===== */


/* ===== 4. ENHANCED BUTTONS ===== */
.btn-enhanced {
    position: relative;
    overflow: hidden;
    transition: var(--transition-fast);
    transform-style: preserve-3d;
}

    .btn-enhanced:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-lg);
    }

    .btn-enhanced:active {
        transform: translateY(0);
        box-shadow: var(--shadow-sm);
    }

    /* Ripple Effect Container */
    .btn-enhanced .ripple {
        position: absolute;
        border-radius: 50%;
        background-color: rgba(255, 255, 255, 0.6);
        transform: scale(0);
        animation: ripple 600ms linear;
        pointer-events: none;
    }

    /* Icon Rotation */
    .btn-enhanced .icon-rotate {
        transition: transform var(--animation-normal) var(--easing-default);
    }

    .btn-enhanced:hover .icon-rotate {
        transform: rotate(90deg);
    }

/* Magnetic Button Effect */
.btn-magnetic {
    transition: transform var(--animation-fast) var(--easing-smooth);
}

/* Success State Animation */
.btn-success-morph {
    transition: all var(--animation-normal) var(--easing-bounce);
}

    .btn-success-morph.success {
        background-color: var(--accent-success);
        color: white;
    }

        .btn-success-morph.success i {
            animation: rotate var(--animation-slow) var(--easing-default);
        }

/* ===== 5. ENHANCED MODALS ===== */
.modal-enhanced {
    animation: fadeInScale var(--animation-normal) var(--easing-bounce);
}

.modal-backdrop-enhanced {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn var(--animation-fast) var(--easing-default);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content-enhanced {
    transform: scale(1);
    opacity: 1;
    transition: var(--transition-smooth);
}

    .modal-content-enhanced > * {
        animation: fadeInUp var(--animation-normal) var(--easing-default) both;
    }

        .modal-content-enhanced > *:nth-child(1) {
            animation-delay: 100ms;
        }

        .modal-content-enhanced > *:nth-child(2) {
            animation-delay: 200ms;
        }

        .modal-content-enhanced > *:nth-child(3) {
            animation-delay: 300ms;
        }

/* ===== 6. ENHANCED CARDS ===== */
.card-3d {
    transition: var(--transition-base);
    transform-style: preserve-3d;
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg);
}

    .card-3d:hover {
        box-shadow: var(--shadow-xl);
        transform: perspective(1000px) rotateX(0deg) rotateY(0deg) translateZ(10px);
    }

.card-depth {
    position: relative;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-md);
}

    .card-depth:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-xl);
    }

    .card-depth::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        width: 90%;
        height: 10px;
        transform: translateX(-50%);
        background: radial-gradient(ellipse at center, rgba(0,0,0,0.2) 0%, transparent 70%);
        opacity: 0;
        transition: opacity var(--animation-normal) var(--easing-default);
    }

    .card-depth:hover::after {
        opacity: 1;
    }

/* ===== 7. BADGE ANIMATIONS ===== */
.badge-breathe {
    animation: breathe 2s infinite;
}

.badge-enhanced {
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

    .badge-enhanced:hover {
        transform: scale(1.1);
    }

.badge-number-flip {
    display: inline-block;
    perspective: 100px;
}

    .badge-number-flip span {
        display: inline-block;
        animation: numberFlip var(--animation-normal) var(--easing-bounce);
    }

/* ===== 8. LOADING SKELETON ===== */


/* ===== 9. FORM ENHANCEMENTS ===== */
.form-field-enhanced {
    position: relative;
}

    .form-field-enhanced input,
    .form-field-enhanced select,
    .form-field-enhanced textarea {
        transition: var(--transition-fast);
        border: 1px solid #e5e7eb;
    }

        .form-field-enhanced input:focus,
        .form-field-enhanced select:focus,
        .form-field-enhanced textarea:focus {
            border-color: var(--accent-primary);
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
            outline: none;
        }

/* Floating Labels */
.floating-label {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    transition: var(--transition-fast);
    pointer-events: none;
    color: #6b7280;
}

.form-field-enhanced input:focus + .floating-label,
.form-field-enhanced input:not(:placeholder-shown) + .floating-label {
    top: -10px;
    left: 8px;
    font-size: 12px;
    background-color: white;
    padding: 0 4px;
    color: var(--accent-primary);
}

/* ===== 10. ANALYTICS ENHANCEMENTS ===== */
.analytics-card-enhanced {
    transition: var(--transition-base);
    cursor: pointer;
}

    .analytics-card-enhanced:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-xl);
    }

.analytics-number {
    font-weight: bold;
    display: inline-block;
}

.chart-container svg {
    transition: var(--transition-base);
}

    .chart-container svg:hover {
        transform: scale(1.02);
    }

/* Donut Chart Animation */
.donut-path {
    stroke-dasharray: 440;
    stroke-dashoffset: 440;
    animation: drawCircle 1s ease-out forwards;
}

/* ===== 11. TOOLTIP ENHANCEMENTS ===== */
.tooltip-enhanced {
    position: relative;
}

    .tooltip-enhanced::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%) translateY(10px);
        background-color: #1f2937;
        color: white;
        padding: 6px 12px;
        border-radius: 4px;
        font-size: 12px;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: var(--transition-fast);
    }

    .tooltip-enhanced:hover::after {
        opacity: 1;
        transform: translateX(-50%) translateY(-5px);
    }

/* ===== 12. UTILITY CLASSES ===== */
.animate-fadeIn {
    animation: fadeInUp var(--animation-normal) var(--easing-default);
}

.animate-slideIn {
    animation: slideInRight var(--animation-normal) var(--easing-default);
}

.transition-smooth {
    transition: var(--transition-smooth);
}

.hover-lift:hover {
    transform: translateY(-2px);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.no-select {
    user-select: none;
    -webkit-user-select: none;
}

/* ===== 13. RESPONSIVE ADJUSTMENTS ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== 14. COPY BUTTON ENHANCEMENT ===== */
.copy-btn-enhanced {
    position: relative;
    transition: var(--transition-fast);
}

    .copy-btn-enhanced.copied {
        background-color: var(--accent-success);
        color: white;
    }

        .copy-btn-enhanced.copied i {
            animation: rotate var(--animation-normal) var(--easing-default);
        }

/* ===== 15. ACTION MENU ENHANCEMENTS ===== */
.action-menu-enhanced {
    position: relative;
}

    .action-menu-enhanced .dropdown-menu {
        animation: fadeInScale var(--animation-fast) var(--easing-bounce);
        transform-origin: top right;
    }

    .action-menu-enhanced .dropdown-item {
        transition: var(--transition-fast);
    }

        .action-menu-enhanced .dropdown-item:hover {
            background-color: rgba(59, 130, 246, 0.1);
            padding-left: 20px;
        }

        .action-menu-enhanced .dropdown-item i {
            transition: transform var(--animation-fast) var(--easing-default);
        }

        .action-menu-enhanced .dropdown-item:hover i {
            transform: scale(1.2);
        }

/* ===== 16. DROPDOWN Z-INDEX FIXES ===== */
.table-responsive {
    overflow: visible !important;
}

.dataGrid-container {
    overflow: visible !important;
}

/* Blazorise specific dropdown fixes */
.b-is-autocomplete-menu,
.dropdown-menu {
    z-index: 9999 !important;
}

.dropdown.show .dropdown-menu {
    z-index: 9999 !important;
    position: absolute !important;
}

/* Ensure dropdowns appear above everything */
.entity-actions .dropdown-menu {
    z-index: 10000 !important;
}