/**
 * Enhanced CSS Styling
 * Additional styles for better UX and visual appeal
 */

/* Advanced Animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-200deg);
    }
    to {
        opacity: 1;
        transform: rotate(0deg);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.3);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes flipInX {
    from {
        opacity: 0;
        transform: perspective(400px) rotateX(90deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateX(0deg);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1); }
    50% { transform: scale(1); }
    75% { transform: scale(1.05); }
}

/* Animation Classes */
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-rotate-in { animation: rotateIn 0.6s ease-out; }
.animate-zoom-in { animation: zoomIn 0.5s ease-out; }
.animate-flip-in-x { animation: flipInX 0.6s ease-out; }
.animate-slide-in-down { animation: slideInDown 0.5s ease-out; }
.animate-heartbeat { animation: heartbeat 1.5s ease-in-out infinite; }

/* Interactive Elements */
.interactive-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.interactive-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

.interactive-card:active {
    transform: translateY(-4px) scale(0.98);
}

/* Enhanced Buttons */
.btn-floating {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.btn-floating:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.4);
}

.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn-ripple:active::before {
    width: 300px;
    height: 300px;
}

/* Notification Enhancements */
.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    animation: pulse 2s infinite;
}

/* Loading States */
.skeleton {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.loading-dots::after {
    content: '';
    animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* Enhanced Inputs */
.input-group {
    position: relative;
}

.input-floating-label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    transition: all 0.3s ease;
    pointer-events: none;
    background: #1f2937;
    padding: 0 4px;
}

.form-input:focus + .input-floating-label,
.form-input:not(:placeholder-shown) + .input-floating-label {
    top: 0;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: #667eea;
}

/* Data Visualization */
.chart-container {
    position: relative;
    background: rgba(31, 41, 55, 0.5);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(16px);
    border: 1px solid rgba(75, 85, 99, 0.3);
}

.stat-card {
    background: linear-gradient(145deg, #1f2937, #111827);
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Table Enhancements */
.table-modern {
    background: rgba(31, 41, 55, 0.5);
    backdrop-filter: blur(16px);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(75, 85, 99, 0.3);
}

.table-modern th {
    background: rgba(17, 24, 39, 0.8);
    position: sticky;
    top: 0;
    z-index: 10;
}

.table-modern tr {
    transition: all 0.2s ease;
}

.table-modern tr:hover {
    background: rgba(59, 130, 246, 0.1);
    transform: scale(1.01);
}

/* Timeline Component */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.75rem;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #667eea;
    border: 3px solid #1f2937;
}

.timeline-item.active::before {
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
}

/* Tag System */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(75, 85, 99, 0.3);
    color: #d1d5db;
    transition: all 0.2s ease;
}

.tag:hover {
    transform: scale(1.05);
    background: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

.tag.tag-primary { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.tag.tag-success { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.tag.tag-warning { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.tag.tag-error { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }

/* Search and Filter */
.search-container {
    position: relative;
}

.search-container .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    transition: color 0.3s ease;
}

.search-container .form-input:focus ~ .search-icon {
    color: #667eea;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    background: rgba(75, 85, 99, 0.3);
    color: #d1d5db;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.filter-chip:hover,
.filter-chip.active {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
    color: #93c5fd;
    transform: translateY(-1px);
}

/* Progress Indicators */
.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    transition: stroke-dashoffset 0.5s ease-in-out;
    stroke: #667eea;
    stroke-width: 3;
    fill: transparent;
    stroke-linecap: round;
}

/* Responsive Grid */
.responsive-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.responsive-grid.dense {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .btn-floating {
        bottom: 1rem;
        right: 1rem;
        width: 48px;
        height: 48px;
    }
    
    .responsive-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .timeline {
        padding-left: 1.5rem;
    }
    
    .timeline::before {
        left: 0.75rem;
    }
    
    .timeline-item::before {
        left: -1.25rem;
    }
    
    .stat-value {
        font-size: 2rem;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .card-modern,
    .table-modern {
        background: white !important;
        border: 1px solid #ccc !important;
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Indicators */
.focus-ring:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.focus-ring:focus:not(:focus-visible) {
    outline: none;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .card-modern,
    .table-modern {
        border: 2px solid #ffffff;
    }
    
    .btn-modern {
        border: 2px solid #ffffff;
    }
}