/* =============================================
   TMAG Command Center - Application Styles
   Complements Tailwind CDN - custom components
   ============================================= */

/* ── Glass Card Component ── */
.tmag-glass {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tmag-glass:hover {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px -8px rgba(0, 0, 0, 0.3);
}

/* ── Neon Glow Effects ── */
.glow-cyan {
    box-shadow: 0 0 20px -5px rgba(6, 182, 212, 0.3);
}

.glow-cyan-hover:hover {
    box-shadow: 0 0 30px -5px rgba(6, 182, 212, 0.4),
                0 0 60px -15px rgba(6, 182, 212, 0.2);
    border-color: rgba(6, 182, 212, 0.3);
}

.glow-purple {
    box-shadow: 0 0 20px -5px rgba(139, 92, 246, 0.3);
}

.glow-purple-hover:hover {
    box-shadow: 0 0 30px -5px rgba(139, 92, 246, 0.4),
                0 0 60px -15px rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.3);
}

.glow-green {
    box-shadow: 0 0 20px -5px rgba(16, 185, 129, 0.3);
}

.glow-green-hover:hover {
    box-shadow: 0 0 30px -5px rgba(16, 185, 129, 0.4),
                0 0 60px -15px rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.3);
}

/* ── Animated Gradient Border ── */
.gradient-border {
    position: relative;
    overflow: hidden;
}

.gradient-border::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, #06b6d4, #8b5cf6, #10b981);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gradient-border:hover::before {
    opacity: 1;
}

/* ── Sidebar Styles ── */
#tmag-sidebar-nav a,
#tmag-sidebar-nav button {
    position: relative;
    overflow: hidden;
}

#tmag-sidebar-nav a::before,
#tmag-sidebar-nav button::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 60%;
    background: linear-gradient(to bottom, #06b6d4, #8b5cf6);
    border-radius: 0 2px 2px 0;
    transition: width 0.2s ease;
}

#tmag-sidebar-nav a:hover::before,
#tmag-sidebar-nav button:hover::before {
    width: 3px;
}

/* ── KPI Card Animations ── */
@keyframes countUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.kpi-value {
    animation: countUp 0.6s ease-out forwards;
}

/* ── Pulse Indicators ── */
@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.status-pulse {
    animation: statusPulse 2s ease-in-out infinite;
}

/* ── Loading Skeleton ── */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.03) 25%,
        rgba(255, 255, 255, 0.06) 50%,
        rgba(255, 255, 255, 0.03) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
}

/* ── Notification Toast ── */
.tmag-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tmag-toast.show {
    transform: translateX(0);
}

/* ── Tab Indicator ── */
.tab-active {
    position: relative;
}

.tab-active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 20%;
    width: 60%;
    height: 2px;
    background: linear-gradient(to right, #06b6d4, #8b5cf6);
    border-radius: 1px;
}

/* ── Data Table ── */
.tmag-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.tmag-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(148, 163, 184, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
}

.tmag-table tbody td {
    padding: 12px 16px;
    font-size: 13px;
    color: #cbd5e1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.15s ease;
}

.tmag-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* ── Badge Component ── */
.tmag-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.6;
}

.tmag-badge-cyan {
    background: rgba(6, 182, 212, 0.1);
    color: #06b6d4;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.tmag-badge-purple {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.tmag-badge-green {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.tmag-badge-amber {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.tmag-badge-red {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ── Responsive Adjustments ── */
@media (max-width: 768px) {
    .tmag-toast {
        left: 16px;
        right: 16px;
        top: auto;
        bottom: 16px;
    }
}

/* ── Print Styles ── */
@media print {
    aside,
    header,
    footer,
    .no-print {
        display: none !important;
    }

    main {
        margin: 0 !important;
        padding: 0 !important;
    }

    body {
        background: #fff;
        color: #000;
    }
}


/* =============================================
   WebGL Enhancement Styles
   ============================================= */

/* ── Glassmorphism Cards (Enhanced) ── */
.tmag-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}
.tmag-card:hover {
    border-color: rgba(6, 182, 212, 0.3);
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.1), inset 0 0 30px rgba(6, 182, 212, 0.02);
    transform: translateY(-2px);
}

/* ── Glitch Text Animation ── */
.glitch-title {
    position: relative;
    display: inline-block;
}
.glitch-title::before,
.glitch-title::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}
.glitch-title:hover::before {
    animation: glitch-1 0.3s linear;
    color: #06b6d4;
    z-index: -1;
    opacity: 0.8;
}
.glitch-title:hover::after {
    animation: glitch-2 0.3s linear;
    color: #8b5cf6;
    z-index: -2;
    opacity: 0.8;
}
@keyframes glitch-1 {
    0% { clip-path: inset(20% 0 60% 0); transform: translate(-3px, -3px); }
    25% { clip-path: inset(60% 0 10% 0); transform: translate(3px, 3px); }
    50% { clip-path: inset(30% 0 40% 0); transform: translate(-3px, 3px); }
    75% { clip-path: inset(70% 0 5% 0); transform: translate(3px, -3px); }
    100% { clip-path: inset(10% 0 80% 0); transform: translate(0); }
}
@keyframes glitch-2 {
    0% { clip-path: inset(60% 0 20% 0); transform: translate(3px, 3px); }
    25% { clip-path: inset(10% 0 60% 0); transform: translate(-3px, -3px); }
    50% { clip-path: inset(40% 0 30% 0); transform: translate(3px, -3px); }
    75% { clip-path: inset(5% 0 70% 0); transform: translate(-3px, 3px); }
    100% { clip-path: inset(80% 0 10% 0); transform: translate(0); }
}

/* ── Scroll Reveal Animations ── */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ── Neon Glow Effects on Interactive Elements ── */
.neon-cyan { transition: box-shadow 0.3s ease; }
.neon-cyan:hover { box-shadow: 0 0 20px rgba(6, 182, 212, 0.4), 0 0 40px rgba(6, 182, 212, 0.1); }
.neon-purple { transition: box-shadow 0.3s ease; }
.neon-purple:hover { box-shadow: 0 0 20px rgba(139, 92, 246, 0.4), 0 0 40px rgba(139, 92, 246, 0.1); }
.neon-green { transition: box-shadow 0.3s ease; }
.neon-green:hover { box-shadow: 0 0 20px rgba(16, 185, 129, 0.4), 0 0 40px rgba(16, 185, 129, 0.1); }

/* ── Pulsing Dot Indicators ── */
.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

/* ── WebGL Canvas Layering ── */
#webgl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}
.tmag-content-layer {
    position: relative;
    z-index: 1;
}

/* ── Particle Button Effect ── */
.particle-btn {
    position: relative;
    overflow: hidden;
}
.particle-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(6, 182, 212, 0.15) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}
.particle-btn:hover::after {
    opacity: 1;
}


/* ==========================================
   Store Logos - Brand Identity
   ========================================== */

/* Sidebar Logo */
.tmag-sidebar-logo {
    transition: all 0.3s ease;
}
.tmag-sidebar-logo img {
    filter: brightness(1.1);
    transition: all 0.3s ease;
}
.tmag-sidebar-logo img:hover {
    filter: brightness(1.3);
}

/* Store sub-menu logos */
#tmag-sidebar-nav img {
    filter: brightness(0.85);
    transition: all 0.2s ease;
}
#tmag-sidebar-nav a:hover img,
#tmag-sidebar-nav a.text-white img {
    filter: brightness(1.1);
}

/* Dashboard store card logos */
.tmag-card img[loading="lazy"] {
    filter: brightness(1.05);
    transition: all 0.3s ease;
}
.tmag-card:hover img[loading="lazy"] {
    filter: brightness(1.2);
    transform: scale(1.05);
}

/* Store page header logo */
.gradient-border img[loading="lazy"] {
    filter: brightness(1.1);
}
