/* Custom Properties */
:root {
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glow-purple: #a855f7;
    --glow-blue: #3b82f6;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --animation-duration: 0.3s;
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated Grid Background */
.grid-background {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* Glassmorphism Effects */
.glass-morphism {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

.glass-card {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    transition: all var(--animation-duration) cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* User Profile Styles */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all var(--animation-duration);
    cursor: pointer;
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--glow-purple), var(--glow-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.user-avatar::after {
    content: '';
    position: absolute;
    inset: -50%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: rotate-slow 4s linear infinite;
}

.user-avatar span {
    position: relative;
    z-index: 1;
}

/* Hover Effects */
.hover-lift {
    transition: all var(--animation-duration) cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 20px 40px rgba(168, 85, 247, 0.1),
        0 10px 20px rgba(59, 130, 246, 0.1);
}

/* Logo Glow & Rotation */
.logo-glow {
    position: relative;
    display: flex; 
    align-items: center;
    justify-content: center;
    width: 40px; 
    height: 40px; 
}

.logo-glow::after {
    content: '';
    position: absolute;
    inset: -10px; 
    background: radial-gradient(circle, var(--glow-purple) 0%, transparent 70%);
    opacity: 0.3;
    filter: blur(20px);
    animation: pulse-glow 2s ease-in-out infinite;
    z-index: -2; 
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.5; }
}

.header-logo-rotate {
    transform-origin: center;
    animation: rotate-logo-clockwise 30s linear infinite; 
}

@keyframes rotate-logo-clockwise {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Status Indicators */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 999px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 10px #22c55e;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; box-shadow: 0 0 10px #22c55e; }
    50% { opacity: 0.6; box-shadow: 0 0 20px #22c55e; }
    100% { opacity: 1; box-shadow: 0 0 10px #22c55e; }
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
}

.pulse-dot::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: inherit;
    opacity: 0.4;
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(0.8); opacity: 0.4; }
    50% { transform: scale(1.2); opacity: 0.2; }
    100% { transform: scale(0.8); opacity: 0.4; }
}

/* Metric Rows */
.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}

.metric-row:last-child {
    border-bottom: none;
}

.metric-row:hover {
    padding-left: 8px;
    background: rgba(255, 255, 255, 0.02);
}

/* Table Styles */
table {
    border-collapse: collapse;
}

tbody tr {
    transition: all 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

tbody tr.trade-row-new {
    animation: fade-in 0.3s ease-out;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Strategy Cards */
.strategy-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    transition: all var(--animation-duration);
    position: relative;
    overflow: hidden;
}

.strategy-card.active {
    border-color: rgba(34, 197, 94, 0.3);
}

.strategy-card.paused {
    opacity: 0.5;
    border-color: rgba(239, 68, 68, 0.3);
}

.strategy-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, var(--glow-purple), var(--glow-blue));
    opacity: 0;
    transition: opacity var(--animation-duration);
}

.strategy-card:hover::before {
    opacity: 1;
}

/* Value Change Animations */
.value-change-positive {
    animation: flash-green 0.5s;
}

.value-change-negative {
    animation: flash-red 0.5s;
}

@keyframes flash-green {
    0%, 100% { color: inherit; }
    50% { color: #22c55e; text-shadow: 0 0 10px #22c55e; }
}

@keyframes flash-red {
    0%, 100% { color: inherit; }
    50% { color: #ef4444; text-shadow: 0 0 10px #ef4444; }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Loading Animation */
.loading-pulse {
    display: inline-block;
    width: 100%;
    height: 20px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.1), 
        transparent);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

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

/* Position Items */
.position-item {
    animation: slide-in 0.3s ease-out;
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Market Sentiment Gauge */
#gradient {
    transition: all 0.5s ease;
}

/* Sparkline Container */
[id$="-spark"] {
    height: 30px;
    opacity: 0.8;
}

/* Order Flow Animation */
#buy-volume-bar,
#sell-volume-bar,
#net-flow-bar {
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Chart Buttons */
button {
    transition: all 0.2s;
}

/* Risk Analytics Progress Bars */
.risk-bar {
    position: relative;
    overflow: hidden;
}

.risk-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer-slow 4s infinite;
}

@keyframes shimmer-slow {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Alert Animations */
.alert-item {
    animation: alert-slide-in 0.3s ease-out;
}

@keyframes alert-slide-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#alerts-container {
    max-height: 80vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

#alerts-container::-webkit-scrollbar {
    width: 4px;
}

#alerts-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

/* Chart Container Styles */
canvas { 
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

#tradingview-chart, #order-flow-chart {
    background: rgba(0,0,0,0.4); 
}

/* MT Account Cards */
.mt-account-card {
    opacity: 0;
    transform: translateY(20px);
    animation: fade-in-up 0.3s ease-out forwards;
}

@keyframes fade-in-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mt-account-card.disconnected {
    opacity: 0.6;
}

.mt-card-glow {
    background: rgba(255, 255, 255, 0.02); 
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    transition: all var(--animation-duration);
}

.mt-card-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, var(--glow-purple), var(--glow-blue), var(--glow-purple));
    background-size: 200% 200%;
    border-radius: 12px;
    opacity: 0;
    transition: opacity var(--animation-duration);
    animation: gradient-rotate 4s ease infinite;
    z-index: -1;
}

.mt-card-glow:hover::before {
    opacity: 0.5;
}

.mt-card-glow::after { 
    content: '';
    position: absolute;
    inset: -1px;
    background: #000; 
    border-radius: 12px;
    z-index: -1;
}

@keyframes gradient-rotate {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.card-updated-flash {
  animation: subtle-card-flash 0.75s ease-out;
}

@keyframes subtle-card-flash {
  0%, 100% { background-color: rgba(255, 255, 255, 0.02); } 
  50% { background-color: rgba(255, 255, 255, 0.06); }
}

.margin-critical { color: #ef4444; }
.margin-warning { color: #f59e0b; }
.margin-safe { color: #22c55e; }

.bg-gradient-to-r { 
    position: relative;
    overflow: hidden;
}

.bg-gradient-to-r::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.1) 0%, transparent 70%);
    animation: rotate-slow 20s linear infinite;
    pointer-events: none;
}

@keyframes rotate-slow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fade-in-element {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-element.visible {
    opacity: 1;
    transform: translateY(0);
}

.will-change-transform {
    will-change: transform;
}

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Mobile Navigation Styles */
.mobile-menu-button {
    padding: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all var(--animation-duration);
}

.mobile-menu-button:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.desktop-navigation {
    display: none;
}

@media (min-width: 768px) {
    .desktop-navigation {
        display: flex;
        align-items: center;
        gap: 1.5rem;
    }
}

.nav-link {
    color: #9ca3af;
    font-size: 0.875rem;
    transition: color 0.2s;
    position: relative;
}

.nav-link:hover {
    color: white;
}

.nav-link.active {
    color: white;
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1.25rem;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--glow-purple), var(--glow-blue));
}

/* Mobile Navigation Menu */
.mobile-navigation {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 1rem;
    padding-top: 1rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.mobile-navigation.mobile-nav-open {
    max-height: 500px;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    color: #9ca3af;
    transition: color 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-nav-link:hover {
    color: white;
}

.mobile-nav-link.active {
    color: white;
    font-weight: 600;
}

.mobile-nav-link.active {
    background: rgba(168, 85, 247, 0.1);
    border-left: 3px solid #a855f7;
    padding-left: calc(0.75rem - 3px);
}

.mobile-nav-stats {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Header Stats Responsive */
.header-stats {
    display: none;
}

@media (min-width: 640px) {
    .header-stats {
        display: flex;
        align-items: center;
        gap: 1rem;
        font-size: 0.875rem;
    }
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-label {
    color: #9ca3af;
}

.stat-value {
    font-family: monospace;
}

.stat-divider {
    width: 1px;
    height: 1rem;
    background: rgba(255, 255, 255, 0.2);
}

/* System Time Responsive */
.system-time-container {
    font-size: 0.75rem;
}

.system-time-label {
    color: #9ca3af;
    display: none;
}

@media (min-width: 640px) {
    .system-time-container {
        font-size: 0.875rem;
    }
    
    .system-time-label {
        display: block;
    }
}

.system-time-value {
    color: white;
    font-family: monospace;
}

/* User Dropdown Responsive */
.user-dropdown {
    position: absolute;
    right: 0;
    margin-top: 0.5rem;
    width: 14rem;
    transform-origin: top right;
    background: rgb(38, 38, 38);
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    padding: 0.25rem 0;
    z-index: 50;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 640px) {
    .user-dropdown {
        right: -1rem;
        width: calc(100vw - 2rem);
        max-width: 20rem;
    }
}

.dropdown-link {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #d1d5db;
    transition: all 0.15s;
}

.dropdown-link:hover {
    background: rgb(64, 64, 64);
    color: white;
}

/* Market Badges */
.market-badge {
    font-size: 0.625rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

.market-badge.positive {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.market-badge.negative {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Chart Timeframe Buttons */
.chart-timeframe-btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.625rem;
    border-radius: 0.25rem;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
}

@media (min-width: 640px) {
    .chart-timeframe-btn {
        font-size: 0.75rem;
    }
}

.chart-timeframe-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chart-timeframe-btn.active {
    background: rgba(168, 85, 247, 0.3);
    color: #c084fc;
}

/* Position Item Mobile */
.position-item > div {
    padding: 0.75rem;
}

@media (max-width: 640px) {
    .position-item .text-xs {
        font-size: 0.625rem;
    }
}

/* Table Responsive */
@media (max-width: 640px) {
    table {
        font-size: 0.75rem;
    }
    
    .table-cell-hide-mobile {
        display: none;
    }
}

/* Alerts Mobile */
@media (max-width: 640px) {
    #alerts-container {
        bottom: 1rem;
        right: 1rem;
        width: calc(100vw - 2rem);
    }
}

/* Touch-friendly hover states */
@media (hover: hover) and (pointer: fine) {
    .hover-lift:hover {
        transform: translateY(-4px);
        box-shadow: 
            0 20px 40px rgba(168, 85, 247, 0.1),
            0 10px 20px rgba(59, 130, 246, 0.1);
    }
}

/* Improve tap targets for mobile */
@media (max-width: 768px) {
    button, a, .clickable {
        min-height: 44px;
        min-width: 44px;
    }
    
    .user-profile {
        padding: 12px;
    }
    
    .user-profile .user-info {
        display: none;
    }
    
    .user-profile .user-profile-caret {
        display: none;
    }
    
    .user-profile {
        padding: 8px;
    }
}

/* Smooth scrolling for mobile */
html {
    scroll-behavior: smooth;
}

/* Prevent horizontal scroll on mobile */
body {
    overflow-x: hidden;
}

/* Better mobile glass morphism */
@media (max-width: 640px) {
    .glass-card {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border-radius: 12px;
        padding: 1rem;
    }
    
    .metric-row {
        font-size: 14px;
    }
}

/* Additional Mobile Optimizations */
@media (max-width: 640px) {
    /* Stack buttons vertically on mobile */
    .flex-col-mobile {
        flex-direction: column;
    }
    
    /* Full width buttons on mobile */
    .w-full-mobile {
        width: 100%;
    }
}

/* Touch-friendly Strategy Cards */
.strategy-card {
    min-height: 44px;
    touch-action: manipulation;
}

/* Mobile Modal Improvements */
@media (max-width: 640px) {
    .fixed.inset-0 {
        padding: 1rem;
    }
    
    /* Full screen modals on mobile */
    .glass-morphism {
        border-radius: 0.75rem;
        max-height: calc(100vh - 2rem);
    }
}

/* Responsive Table Scroll */
.overflow-x-auto {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

/* Responsive Typography */
@media (max-width: 640px) {
    /* Smaller text on mobile */
    .text-2xl {
        font-size: 1.5rem;
    }
    
    .text-xl {
        font-size: 1.25rem;
    }
    
    .text-lg {
        font-size: 1.125rem;
    }
    
    .text-base {
        font-size: 0.875rem;
    }
    
    .text-sm {
        font-size: 0.75rem;
    }
    
    .text-xs {
        font-size: 0.625rem;
    }
}

/* Mobile Chart Container */
@media (max-width: 640px) {
    canvas {
        max-height: 300px;
    }
}

/* Responsive Metric Cards */
.metric-card {
    transition: all 0.2s;
}

@media (hover: none) {
    /* Remove hover effects on touch devices */
    .hover-lift:hover {
        transform: none;
        box-shadow: none;
    }
    
    /* Add active states for touch */
    .hover-lift:active {
        transform: scale(0.98);
    }
}

/* Mobile Form Inputs */
@media (max-width: 640px) {
    input, select, textarea {
        font-size: 16px; /* Prevent zoom on iOS */
        min-height: 44px;
    }
}

/* Responsive Spacing Utilities */
.gap-responsive {
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .gap-responsive {
        gap: 1.5rem;
    }
}

/* Mobile Alert Positioning */
#alerts-container {
    pointer-events: none;
}

#alerts-container > * {
    pointer-events: auto;
}

/* Improve Mobile Loading States */
.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: loading-wave 1.5s infinite;
}

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

/* Mobile Touch Feedback */
button, a, .clickable {
    -webkit-tap-highlight-color: rgba(168, 85, 247, 0.2);
}

/* Responsive Status Badges */
.status-badge {
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
}

@media (min-width: 640px) {
    .status-badge {
        font-size: 0.75rem;
        padding: 0.125rem 0.5rem;
    }
}

/* Mobile Dropdown Improvements */
.dropdown-mobile {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    border-radius: 1rem 1rem 0 0;
    max-height: 70vh;
    overflow-y: auto;
}

.dropdown-mobile.open {
    transform: translateY(0);
}

/* Safe Area Insets for Modern Phones */
@supports (padding: max(0px)) {
    .container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    
    header {
        padding-top: max(0.75rem, env(safe-area-inset-top));
    }
    
    .fixed.bottom-0 {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

/* Responsive Grid System */
@media (max-width: 640px) {
    .grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 640px) {
    .sm\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    
    .md\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    
    .lg\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Performance Optimizations */
.will-change-transform {
    will-change: transform;
}

.hardware-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .grid-background {
        animation: none;
    }
    
    .pulse-dot::after {
        animation: none;
    }
}

/* Dark Mode Support (for future enhancement) */
@media (prefers-color-scheme: dark) {
    /* Already dark theme, but can add specific adjustments here */
}

/* Print Styles */
@media print {
    .no-print,
    header,
    nav,
    button,
    .mobile-menu-button,
    #alerts-container {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .glass-card {
        background: white;
        border: 1px solid #ddd;
        box-shadow: none;
    }
}

/* Login Page Specific Styles */
.login-logo-spin {
    animation: rotate-logo-clockwise 45s linear infinite;
}

.input-glow:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.5), 0 0 15px rgba(168, 85, 247, 0.3);
}

.submit-button {
    background: #a855f7;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.submit-button::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, #a855f7, #3b82f6, #a855f7);
    background-size: 200% 200%;
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.3s;
    animation: gradient-rotate 3s ease infinite;
    z-index: -1;
}

.submit-button:hover::before {
    opacity: 1;
}

.submit-button::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: #a855f7;
    border-radius: 10px;
    z-index: -1;
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.4);
}