/* ===== TrackyGH Visual Enhancements ===== */

/* Animations & Transitions */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Smooth page load */
.page-shell {
    animation: fadeIn 0.5s ease-in-out;
}

/* Card hover effects */
.card-glass {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* White background containers need dark text */
.card-glass[style*="background: white"],
.card-glass[style*="background:#fff"],
.card-glass[style*="background-color: white"],
.card-glass[style*="background-color:#fff"],
div[style*="background: white"],
div[style*="background:#fff"],
div[style*="background-color: white"],
div[style*="background-color:#fff"],
button[style*="background: white"],
button[style*="background:#fff"],
.scan-mode-btn,
[class*="btn"][style*="background: white"],
[class*="btn"][style*="background:#fff"] {
    color: #000000 !important;
}

div[style*="background: white"] *:not(.btn):not(.badge):not(.pill),
div[style*="background:#fff"] *:not(.btn):not(.badge):not(.pill),
div[style*="background-color: white"] *:not(.btn):not(.badge):not(.pill),
div[style*="background-color:#fff"] *:not(.btn):not(.badge):not(.pill) {
    color: #000000 !important;
}

/* Ensure input and select elements on white backgrounds also have black text */
input[style*="background: white"],
input[style*="background:#fff"],
select[style*="background: white"],
select[style*="background:#fff"],
textarea[style*="background: white"],
textarea[style*="background:#fff"] {
    color: #000000 !important;
}

.card-glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transition: left 0.5s;
}

.card-glass:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 60px rgba(34, 211, 238, 0.15), 0 0 0 1px rgba(34, 211, 238, 0.2);
    border-color: rgba(34, 211, 238, 0.3);
}

.card-glass:hover::before {
    left: 100%;
}

/* Button enhancements */
.btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    font-weight: 600;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:active {
    transform: scale(0.97);
}

.btn-accent {
    position: relative;
    overflow: hidden;
}

.btn-accent::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    bottom: -50%;
    left: -50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), transparent);
    transform: rotateZ(60deg) translate(-5em, 7.5em);
}

.btn-accent:hover::after {
    animation: sheen 1s forwards;
}

@keyframes sheen {
    100% {
        transform: rotateZ(60deg) translate(1em, -9em);
    }
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent);
    color: var(--accent) !important;
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.2);
}

/* Pill animations */
.pill {
    transition: all 0.3s ease;
    cursor: default;
}

.pill:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(34, 211, 238, 0.2);
}

/* Hero section enhancements */
.hero {
    animation: fadeInUp 0.8s ease-out;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Table enhancements */
.table {
    animation: fadeInUp 0.6s ease-out;
}

/* Tables with white/light backgrounds */
.table-light, 
.table-striped.table-light tbody tr,
.bg-white .table,
.card-white .table,
table[style*="background: white"],
table[style*="background:#fff"],
table[style*="background-color: white"],
table[style*="background-color:#fff"] {
    color: #000000 !important;
}

.table-light thead th,
.bg-white .table thead th,
.card-white .table thead th {
    color: #000000 !important;
    font-weight: 700;
}

.table-light tbody td,
.bg-white .table tbody td,
.card-white .table tbody td {
    color: #000000 !important;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background: rgba(34, 211, 238, 0.05) !important;
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.table thead th {
    position: relative;
    transition: all 0.3s ease;
}

.table thead th:hover {
    background: rgba(34, 211, 238, 0.1);
    color: var(--accent);
}

/* Form enhancements */
.form-control, .form-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--stroke);
    color: #ffffff;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.form-control:focus, .form-select:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1), 0 4px 12px rgba(34, 211, 238, 0.2);
    transform: translateY(-2px);
    color: #ffffff;
}

.form-control::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.form-label {
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.form-control:focus + .form-label,
.form-control:not(:placeholder-shown) + .form-label {
    color: var(--accent);
}

/* Alert enhancements */
.alert {
    animation: slideInRight 0.5s ease-out;
    border-left: 4px solid;
    position: relative;
    overflow: hidden;
}

.alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 4px;
    background: linear-gradient(180deg, transparent, currentColor, transparent);
    animation: pulse 2s ease-in-out infinite;
}

.alert-success {
    border-left-color: #22c55e;
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.05));
}

.alert-danger {
    border-left-color: #ef4444;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
}

.alert-warning {
    border-left-color: #f59e0b;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
}

.alert-info {
    border-left-color: #3b82f6;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.05));
}

/* Navbar enhancements */
.navbar {
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.navbar-brand {
    transition: all 0.3s ease;
    position: relative;
}

.navbar-brand::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.navbar-brand:hover::after {
    width: 100%;
}

.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent);
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.nav-link:hover::before,
.nav-link.active::before {
    width: 80%;
}

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid var(--accent);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Badge enhancements */
.badge {
    transition: all 0.3s ease;
    cursor: default;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
}

.badge:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Progress bar animations */
.progress {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    transition: width 0.6s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

/* Status indicators */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 2s ease-in-out infinite;
}

.status-success { background: #22c55e; }
.status-warning { background: #f59e0b; }
.status-danger { background: #ef4444; }
.status-info { background: #3b82f6; }

/* Icon animations */
.icon-bounce {
    animation: bounce 2s ease-in-out infinite;
}

.icon-spin {
    animation: spin 2s linear infinite;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

/* Tooltip enhancements */
.tooltip-custom {
    position: relative;
    cursor: help;
}

.tooltip-custom::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) scale(0);
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.95);
    color: var(--text);
    border: 1px solid var(--stroke);
    border-radius: 6px;
    white-space: nowrap;
    font-size: 12px;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tooltip-custom::after {
    content: '';
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%) scale(0);
    border: 6px solid transparent;
    border-top-color: rgba(15, 23, 42, 0.95);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tooltip-custom:hover::before,
.tooltip-custom:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* Glassmorphism effects */
.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, var(--accent), #7dd3fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glow effects */
.glow {
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.5);
}

.glow-on-hover {
    transition: all 0.3s ease;
}

.glow-on-hover:hover {
    box-shadow: 0 0 30px rgba(34, 211, 238, 0.6);
}

/* Stagger animation for lists */
.stagger-item {
    animation: fadeInUp 0.6s ease-out backwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }

/* Scroll animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-glass:hover {
        transform: none;
    }
    
    .stagger-item {
        animation-delay: 0s !important;
    }
}

/* Print styles */
@media print {
    .card-glass,
    .btn,
    .alert {
        animation: none !important;
        transition: none !important;
    }
}
