/* ==========================================================================
   Utilities
   ========================================================================== */
/* Layout */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

/* Spacing */
.m-0 { margin: 0; }
.p-0 { padding: 0; }
.mx-auto { margin-left: auto; margin-right: auto; }
.my-4 { margin-top: 1rem; margin-bottom: 1rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }

/* Text */
.text-center { text-align: center; }
.font-bold { font-weight: bold; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }

/* Display */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* ==========================================================================
   Responsive Design & Mobile Optimization
   ========================================================================== */

/* Touch-friendly button sizes for mobile devices */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 48px;
        min-width: 48px;
    }

    a, button {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Tablet & Medium Screens */
@media (max-width: 1024px) {
    h1 { font-size: 3rem; }
    h2 { font-size: 2.25rem; }
    h3 { font-size: 1.75rem; }
    .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }

    .container {
        padding: 0 1.5rem;
    }
}

/* Mobile & Small Tablets */
@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }

    .grid-cols-3,
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }

    .btn {
        width: 100%;
        justify-content: center;
        padding: 0.875rem 1.5rem;
    }

    .card {
        padding: 1.25rem;
    }

    .container {
        padding: 0 1.25rem;
    }

    /* Larger touch targets */
    a, button {
        padding: 0.75rem 1rem;
    }
}

/* Small Mobile Phones */
@media (max-width: 480px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.4rem; }
    p { font-size: 0.95rem; }

    .container {
        padding: 0 1rem;
    }

    .btn {
        font-size: 0.9rem;
        padding: 0.75rem 1.25rem;
    }

    .card {
        padding: 1rem;
        border-radius: 0.75rem;
    }

    /* Stack elements vertically on very small screens */
    .grid {
        gap: 1rem;
    }
}

/* ==========================================================================
   Special Components
   ========================================================================== */
/* Social Icons */
.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.social-icon:hover {
    background: rgba(139, 0, 0, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(139, 0, 0, 0.5);
}

/* Online Counter */
.online-counter {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    gap: 0.5rem;
}

.online-counter .dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 10px var(--glow-bright);
}

/* Animated Letters */
.animated-letter {
    display: inline-block;
    color: var(--primary);
    font-weight: bold;
    text-shadow: 0 0 15px var(--glow-bright);
    position: relative;
    animation:
        wave 2s ease-in-out infinite,
        glowPulse 2s ease-in-out infinite;
    animation-delay: var(--delay);
}

/* Background Patterns */
.pattern-grid {
    background-image: linear-gradient(rgba(139, 0, 0, 0.15) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(139, 0, 0, 0.15) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Card Variations */
.card-gradient {
    background: linear-gradient(145deg, 
        rgba(255,255,255,0.05) 0%, 
        rgba(255,255,255,0.02) 100%
    );
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    body {
        background: white;
        color: black;
    }

    .no-print {
        display: none;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    a {
        text-decoration: none;
        color: black;
    }
    
    .card,
    .glass-effect {
        background: none;
        border: 1px solid #ddd;
        box-shadow: none;
    }
}

/* ==========================================================================
   Performance Optimizations
   ========================================================================== */
/* Reduce animation on user preference */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Hardware acceleration for animations */
.hw-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

[aria-hidden="true"] {
    display: none;
}

/* High contrast mode adjustments */
@media (forced-colors: active) {
    .btn,
    .card,
    .nav-link {
        border: 2px solid currentColor;
    }
}

/* ==========================================================================
   Root Variables & Reset
   ========================================================================== */
:root {
    --primary: #8B0000;
    --primary-light: #B22222;
    --primary-dark: #5A0000;
    --accent: #DC143C;
    --background: #0A0A0A;
    --background-dark: #050505;
    --background-card: #121212;
    --text: #FFFFFF;
    --text-gray: #AAAAAA;
    --text-muted: #666666;
    --glass: rgba(139, 0, 0, 0.08);
    --glass-light: rgba(255, 255, 255, 0.03);
    --border: rgba(139, 0, 0, 0.3);
    --border-light: rgba(255, 255, 255, 0.08);
    --glow: rgba(139, 0, 0, 0.6);
    --glow-bright: rgba(220, 20, 60, 0.8);
    --shadow-glow: 0 0 20px rgba(139, 0, 0, 0.4);
    --shadow-glow-lg: 0 0 40px rgba(139, 0, 0, 0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
body {
    font-family: 'Inter', sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 3.5rem; font-weight: 700; }
h2 { font-size: 2.5rem; font-weight: 700; }
h3 { font-size: 2rem; font-weight: 600; }
p { margin-bottom: 1rem; }

/* ==========================================================================
   Layout & Grid
   ========================================================================== */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.content-wrapper {
    position: relative;
    z-index: 1;
}

.grid {
    display: grid;
    gap: 2rem;
}

.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ==========================================================================
   Animations & Transitions
   ========================================================================== */
/* Base Transitions */
.transition-all { transition: all 0.3s ease; }
.transition-transform { transition: transform 0.3s ease; }
.transition-opacity { transition: opacity 0.3s ease; }
.transition-smooth { transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.transition-bounce { transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55); }

/* Animation Keyframes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(100%); opacity: 0; }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes wave {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes glowPulse {
    0%, 100% {
        color: var(--primary);
        text-shadow: 0 0 15px var(--glow);
    }
    50% {
        color: var(--accent);
        text-shadow: 0 0 30px var(--glow-bright);
    }
}

@keyframes shine {
    from { transform: translateX(-100%) rotate(30deg); }
    to { transform: translateX(100%) rotate(30deg); }
}

/* Animation Classes */
.animate-slide-in { animation: slideIn 0.3s ease-out forwards; }
.animate-slide-out { animation: slideOut 0.3s ease-out forwards; }
.animate-fadeIn { animation: fadeIn 1s ease-out; }
.animate-fadeInUp { animation: fadeInUp 1s ease-out; }
.animate-fadeInDown { animation: fadeInDown 1s ease-out; }
.animate-slideInLeft { animation: slideInLeft 1s ease-out; }
.animate-slideInRight { animation: slideInRight 1s ease-out; }
.animate-pulse { animation: pulse 2s infinite; }
.animate-rotate { animation: rotate 2s linear infinite; }
.animate-bounce { animation: bounce 2s infinite; }
.animate-shake { animation: shake 0.5s; }
.animate-scale { animation: scale 2s infinite; }

/* Animation Timing */
.animation-delay-100 { animation-delay: 100ms; }
.animation-delay-200 { animation-delay: 200ms; }
.animation-delay-300 { animation-delay: 300ms; }
.animation-delay-400 { animation-delay: 400ms; }
.animation-delay-500 { animation-delay: 500ms; }

.animation-duration-fast { animation-duration: 0.5s; }
.animation-duration-normal { animation-duration: 1s; }
.animation-duration-slow { animation-duration: 2s; }

/* ==========================================================================
   Components
   ========================================================================== */
/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-secondary {
    background: var(--glass);
    border: 1px solid var(--border);
}

/* Cyber Button */
.cyber-button {
    position: relative;
    background: rgba(139, 0, 0, 0.15);
    border: 1px solid var(--primary);
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(139, 0, 0, 0.3);
}

.cyber-button::after {
    content: '';
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    background: linear-gradient(
        60deg,
        transparent 0%,
        rgba(220, 20, 60, 0.3) 50%,
        transparent 100%
    );
    transform: translateX(-100%);
    transition: 0.6s;
}

.cyber-button:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--glow-bright);
}

.cyber-button:hover::after {
    transform: translateX(100%);
}

/* Cards */
.card {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.feature-card {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(139, 0, 0, 0.2),
        transparent
    );
    transition: 0.5s;
}

.feature-card:hover::before {
    left: 100%;
}

.feature-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 30px var(--glow),
                inset 0 0 30px rgba(139, 0, 0, 0.15);
    transform: translateY(-5px);
}

/* Navigation */
.nav-link {
    position: relative;
    padding: 5px 0;
}

.nav-link::before, .nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    transition: 0.3s ease-in-out;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    box-shadow: 0 0 10px var(--glow);
}

.nav-link::before { left: 50%; }
.nav-link::after { right: 50%; }

.nav-link:hover::before,
.nav-link:hover::after {
    width: 50%;
}

/* Forms */
input, textarea, select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text);
    transition: all 0.3s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(139, 0, 0, 0.3), 0 0 20px rgba(139, 0, 0, 0.2);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 2rem;
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 0.5rem;
    border-left: 4px solid var(--primary);
    border: 1px solid var(--border);
    transform: translateX(120%);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 0 20px var(--glow);
}

.toast.show {
    transform: translateX(0);
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    box-shadow: 0 0 10px var(--glow);
    transition: width 0.3s ease;
}

/* ==========================================================================
    Effects & Utilities
   ========================================================================== */
/* Hover Effects */
.hover-glow {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-glow:hover {
    box-shadow: 0 0 30px var(--glow-bright);
    transform: translateY(-2px);
}

.hover-scale {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-scale:hover {
    transform: scale(1.02);
}

/* Glass Effects */
.glass-effect {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Background Effects */
.bg-gradient {
    background: linear-gradient(130deg, var(--background) 0%, var(--background-dark) 100%);
}

/* Text Effects */
.gradient-text {
    background: linear-gradient(45deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

.glow-text {
    text-shadow: 0 0 20px var(--glow-bright);
    color: var(--primary);
}

/* Performance */
.gpu-accelerated {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Z-index */
.z-top { z-index: 1000; }
.z-modal { z-index: 900; }
.z-overlay { z-index: 800; }

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
    box-shadow: 0 0 10px var(--glow);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
    box-shadow: 0 0 15px var(--glow-bright);
}

/* Selection */
::selection {
    background: var(--primary);
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Focus */
:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    box-shadow: 0 0 10px var(--glow);
}

/* ==========================================================================
   Enhanced Dark Red Theme - Glow Effects & Animations
   ========================================================================== */

/* Red Glow Pulse Animation */
@keyframes redGlow {
    0%, 100% {
        box-shadow: 0 0 20px var(--glow), 0 0 40px rgba(139, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 40px var(--glow-bright), 0 0 60px rgba(220, 20, 60, 0.5);
    }
}

/* Pulse Animation for Online Indicator */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(139, 0, 0, 0.7);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 0 10px rgba(139, 0, 0, 0);
    }
}

/* Border Glow Animation */
@keyframes borderGlow {
    0%, 100% {
        border-color: var(--primary);
        box-shadow: 0 0 15px rgba(139, 0, 0, 0.4);
    }
    50% {
        border-color: var(--accent);
        box-shadow: 0 0 30px rgba(220, 20, 60, 0.6);
    }
}

/* Enhanced Button Primary */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: 1px solid var(--primary);
    box-shadow: 0 0 20px rgba(139, 0, 0, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    box-shadow: 0 0 30px var(--glow-bright), 0 4px 20px rgba(139, 0, 0, 0.4);
    transform: translateY(-2px);
}

/* Enhanced Button Secondary */
.btn-secondary:hover {
    background: var(--glass);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(139, 0, 0, 0.3);
}

/* Glowing Card Effect */
.card-glow {
    animation: redGlow 3s ease-in-out infinite;
}

/* Red Neon Border */
.neon-border {
    border: 2px solid var(--primary);
    box-shadow: 0 0 10px var(--glow),
                inset 0 0 10px rgba(139, 0, 0, 0.2);
}

.neon-border:hover {
    border-color: var(--accent);
    box-shadow: 0 0 25px var(--glow-bright),
                inset 0 0 15px rgba(220, 20, 60, 0.3);
}

/* Text Glow Utilities */
.text-glow-sm {
    text-shadow: 0 0 10px var(--glow);
}

.text-glow-md {
    text-shadow: 0 0 20px var(--glow-bright);
}

.text-glow-lg {
    text-shadow: 0 0 30px var(--glow-bright), 0 0 60px rgba(220, 20, 60, 0.4);
}

/* Background Glow Effect */
.bg-glow {
    position: relative;
}

.bg-glow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(139, 0, 0, 0.2) 0%, transparent 70%);
    filter: blur(40px);
    z-index: -1;
}

/* Enhanced Card Hover */
.card:hover {
    border-color: var(--border);
    box-shadow: 0 0 25px rgba(139, 0, 0, 0.2);
}

/* Icon Glow */
.icon-glow {
    filter: drop-shadow(0 0 10px var(--glow));
    transition: filter 0.3s ease;
}

.icon-glow:hover {
    filter: drop-shadow(0 0 20px var(--glow-bright));
}

/* Animated Underline */
.animated-underline {
    position: relative;
    display: inline-block;
}

.animated-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
    box-shadow: 0 0 10px var(--glow);
}

.animated-underline:hover::after {
    transform: scaleX(1);
}

/* Red Particle Background Effect */
.particle-bg {
    position: relative;
    overflow: hidden;
}

.particle-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(2px 2px at 20% 30%, rgba(139, 0, 0, 0.4), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(139, 0, 0, 0.3), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(220, 20, 60, 0.3), transparent),
        radial-gradient(1px 1px at 80% 10%, rgba(139, 0, 0, 0.4), transparent);
    background-size: 200% 200%;
    background-position: 50% 50%;
    animation: particleFloat 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes particleFloat {
    0%, 100% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 100%;
    }
}

/* Enhanced Glass Effect */
.glass-card {
    background: rgba(18, 18, 18, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    box-shadow: 0 4px 30px rgba(139, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.glass-card:hover {
    border-color: var(--border);
    box-shadow: 0 4px 30px rgba(139, 0, 0, 0.3);
}