/* Custom styles for CS Community */

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

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

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(231, 129, 61, 0.3); }
    50% { box-shadow: 0 0 20px rgba(231, 129, 61, 0.6), 0 0 30px rgba(231, 129, 61, 0.4); }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite alternate;
}

.animate-slide-up {
    animation: slideInUp 0.6s ease-out forwards;
}

.animate-fade-scale {
    animation: fadeInScale 0.8s ease-out forwards;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #374151;
}

::-webkit-scrollbar-thumb {
    background: #e7813d;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #d97439;
}

/* Glass morphism effect */
.glass {
    background: rgba(31, 41, 55, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(45deg, #e7813d, #497eba);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hover animations */
.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Card styles */
.card {
    @apply bg-gray-800 bg-opacity-80 backdrop-blur-sm rounded-lg shadow-lg border border-gray-700;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(231, 129, 61, 0.1), transparent);
    transition: left 0.6s;
}

.card:hover::before {
    left: 100%;
}

.card:hover {
    @apply shadow-2xl border-primary/50;
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(231, 129, 61, 0.1);
}

/* Enhanced stat cards - Similar to CTA buttons style */
.stat-card {
    @apply text-center p-6 relative;
    background: linear-gradient(135deg, 
        rgba(31, 41, 55, 0.9) 0%, 
        rgba(17, 24, 39, 0.8) 50%, 
        rgba(31, 41, 55, 0.9) 100%);
    border: 1px solid rgba(231, 129, 61, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.37),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform: translateY(0);
    position: relative;
    min-height: 180px;
    overflow: visible;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(231, 129, 61, 0.1), transparent);
    transition: left 0.6s;
}

.stat-card > * {
    position: relative;
    z-index: 2;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-card:hover {
    transform: translateY(-12px) scale(1.03) perspective(1000px) rotateX(2deg);
    border-color: rgba(231, 129, 61, 0.6);
    background: linear-gradient(135deg, 
        rgba(31, 41, 55, 0.95) 0%, 
        rgba(17, 24, 39, 0.90) 50%, 
        rgba(31, 41, 55, 0.95) 100%);
    backdrop-filter: blur(15px) saturate(1.2);
    box-shadow: 
        0 25px 50px rgba(231, 129, 61, 0.25),
        0 15px 35px rgba(0, 0, 0, 0.5),
        0 5px 15px rgba(231, 129, 61, 0.1),
        inset 0 2px 0 rgba(255, 255, 255, 0.25),
        inset 0 -1px 0 rgba(231, 129, 61, 0.1);
}

/* Enhanced hover effect for icons */
.stat-card:hover .w-12.h-12 {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Special glow effect for stat numbers with margin */
.stat-card .text-4xl,
.stat-card .text-5xl {
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    transition: all 0.4s ease;
    position: relative;
    margin: 0 8px;
    padding: 4px 0;
}

.stat-card:hover .text-4xl,
.stat-card:hover .text-5xl {
    text-shadow: 0 0 30px currentColor, 0 0 15px currentColor;
    filter: brightness(1.2) saturate(1.3);
    transform: scale(1.05);
}

/* Margin for stat card text labels */
.stat-card .text-gray-300 {
    margin: 0 8px;
    padding: 2px 0;
}

.stat-card .text-xs.text-gray-400 {
    margin: 0 8px;
}

/* Enhanced progress bar hover effects */
.stat-card:hover .bg-gradient-to-r {
    transform: scaleX(1.02);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.4), 0 0 8px currentColor;
    transition: all 0.4s ease;
}

/* Progress bar hover shimmer effect */
.stat-card:hover .bg-gradient-to-r::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.6), 
        rgba(255, 255, 255, 0.3),
        transparent);
    animation: shimmerHover 1.5s ease-out;
    border-radius: 10px;
}

@keyframes shimmerHover {
    0% { 
        left: -100%; 
        opacity: 0;
    }
    10% { 
        opacity: 1;
    }
    90% { 
        opacity: 1;
    }
    100% { 
        left: 100%; 
        opacity: 0;
    }
}

/* Enhanced progress bars with better rounding */
.stat-card .bg-gray-700\/50 {
    border-radius: 10px;
    background: rgba(55, 65, 81, 0.3);
    overflow: hidden;
}

.stat-card .bg-gradient-to-r {
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

/* Enhanced responsive adjustments for stat cards */
@media (max-width: 1024px) {
    .stat-card {
        min-height: 170px;
        padding: 1.25rem;
    }

    .stat-card .text-4xl,
    .stat-card .text-5xl {
        font-size: 2.75rem;
        line-height: 1.2;
    }
}

@media (max-width: 768px) {
    .stat-card {
        min-height: 160px;
        padding: 1rem;
    }

    .stat-card .text-4xl,
    .stat-card .text-5xl {
        font-size: 2.5rem;
        line-height: 1.1;
    }

    .stat-card .w-12.h-12 {
        width: 2.5rem;
        height: 2.5rem;
    }

    .stat-card .text-gray-300 {
        font-size: 0.9rem;
    }
}

@media (max-width: 640px) {
    .stat-card {
        min-height: 140px;
        padding: 0.875rem;
    }

    .stat-card .text-4xl,
    .stat-card .text-5xl {
        font-size: 2rem;
        line-height: 1;
    }

    .stat-card .w-12.h-12 {
        width: 2rem;
        height: 2rem;
    }

    .stat-card .text-gray-300 {
        font-size: 0.8rem;
    }

    .stat-card .text-xs.text-gray-400 {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .stat-card {
        min-height: 120px;
        padding: 0.75rem;
    }

    .stat-card .text-4xl,
    .stat-card .text-5xl {
        font-size: 1.75rem;
        line-height: 0.9;
    }

    .stat-card .w-12.h-12 {
        width: 1.75rem;
        height: 1.75rem;
    }
}


/* Server status indicators */
.status-online {
    @apply bg-green-500;
    animation: pulse 2s infinite;
}

.status-offline {
    @apply bg-red-500;
}

.status-unknown {
    @apply bg-yellow-500;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Loading spinner */
.spinner {
    border: 2px solid #374151;
    border-top: 2px solid #e7813d;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

/* Form styles */
.form-input {
    @apply appearance-none relative block w-full px-3 py-2 border border-gray-600 bg-gray-700 placeholder-gray-400 text-white rounded-md focus:outline-none focus:ring-2 focus:ring-primary focus:border-primary;
}

.form-label {
    @apply block text-sm font-medium text-gray-300 mb-2;
}

.btn-primary {
    @apply bg-primary hover:bg-orange-600 text-white px-4 py-2 rounded-md transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-primary;
}

.btn-secondary {
    @apply bg-secondary hover:bg-blue-600 text-white px-4 py-2 rounded-md transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-secondary;
}

/* Modal styles */
.modal-backdrop {
    @apply fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50;
}

.modal-content {
    @apply bg-gray-800 rounded-lg shadow-xl max-w-lg w-full mx-4 max-h-96 overflow-y-auto;
}

/* Tooltip styles */
.tooltip {
    @apply absolute z-10 px-2 py-1 text-sm text-white bg-gray-900 rounded shadow-lg opacity-0 pointer-events-none transition-opacity duration-300;
}

.tooltip-trigger:hover .tooltip {
    @apply opacity-100;
}

/* Forum styles */
.forum-category {
    @apply block p-4 bg-gray-800 bg-opacity-80 rounded-lg border border-gray-700 hover:border-gray-600 transition-all duration-200;
}

.forum-topic {
    @apply block p-3 border-b border-gray-700 hover:bg-gray-700 hover:bg-opacity-50 transition-all duration-200;
}

/* Badge styles */
.badge {
    @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium;
}

.badge-admin {
    @apply bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-300;
}

.badge-moderator {
    @apply bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-300;
}

.badge-user {
    @apply bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300;
}

/* Tournament bracket styles */
.bracket {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.bracket-round {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    min-height: 400px;
}

.bracket-match {
    @apply bg-gray-800 border border-gray-600 rounded p-2 m-1 min-w-48;
}

.bracket-team {
    @apply flex justify-between items-center p-1 border-b border-gray-600 last:border-b-0;
}

.bracket-team.winner {
    @apply bg-green-900 bg-opacity-30;
}

/* Rating stars */
.rating {
    display: inline-flex;
    align-items: center;
}

.rating .star {
    color: #6b7280;
    cursor: pointer;
    transition: color 0.2s;
}

.rating .star.filled,
.rating .star:hover,
.rating .star:hover ~ .star {
    color: #fbbf24;
}

/* Download progress */
.progress-bar {
    @apply w-full bg-gray-700 rounded-full h-2;
}

.progress-fill {
    @apply bg-primary h-2 rounded-full transition-all duration-300;
}

/* Enhanced Responsive utilities */

/* Container adjustments for mobile */
@media (max-width: 1200px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 768px) {
    .mobile-hidden {
        display: none !important;
    }

    .mobile-full {
        width: 100% !important;
    }

    .mobile-stack {
        flex-direction: column !important;
    }

    .mobile-center {
        text-align: center !important;
    }

    /* Grid adjustments */
    .grid-cols-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .grid-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .grid-cols-6 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    /* Text size adjustments */
    .text-6xl {
        font-size: 3rem !important;
        line-height: 1.1 !important;
    }

    .text-5xl {
        font-size: 2.5rem !important;
        line-height: 1.1 !important;
    }

    .text-4xl {
        font-size: 2rem !important;
        line-height: 1.2 !important;
    }

    /* Spacing adjustments */
    .py-24 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    .py-16 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    .py-12 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }

    .px-8 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .space-x-8 > * + * {
        margin-left: 1rem !important;
    }

    .space-x-6 > * + * {
        margin-left: 0.75rem !important;
    }

    /* Button adjustments */
    .btn-primary, .btn-secondary {
        padding: 0.75rem 1.5rem !important;
        font-size: 0.9rem !important;
    }
}

@media (max-width: 640px) {
    /* Further grid adjustments for very small screens */
    .grid-cols-2 {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }

    .grid-cols-3 {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }

    .grid-cols-4 {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }

    .grid-cols-6 {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }

    /* Text adjustments for small screens */
    .text-8xl {
        font-size: 2.5rem !important;
        line-height: 1 !important;
    }

    .text-7xl {
        font-size: 2.25rem !important;
        line-height: 1 !important;
    }

    .text-6xl {
        font-size: 2rem !important;
        line-height: 1 !important;
    }

    .text-5xl {
        font-size: 1.875rem !important;
        line-height: 1 !important;
    }

    .text-4xl {
        font-size: 1.5rem !important;
        line-height: 1.1 !important;
    }

    .text-3xl {
        font-size: 1.375rem !important;
        line-height: 1.2 !important;
    }

    /* More aggressive spacing reductions */
    .py-24 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    .py-16 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }

    .py-12 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    .py-8 {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }

    .px-12 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .px-8 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .px-6 {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* Gap adjustments */
    .gap-8 {
        gap: 1rem !important;
    }

    .gap-6 {
        gap: 0.75rem !important;
    }

    .gap-4 {
        gap: 0.5rem !important;
    }

    /* Margin adjustments */
    .mb-16 {
        margin-bottom: 2rem !important;
    }

    .mb-12 {
        margin-bottom: 1.5rem !important;
    }

    .mb-8 {
        margin-bottom: 1rem !important;
    }

    .mb-6 {
        margin-bottom: 0.75rem !important;
    }

    /* Space between adjustments */
    .space-y-8 > * + * {
        margin-top: 1rem !important;
    }

    .space-y-6 > * + * {
        margin-top: 0.75rem !important;
    }

    .space-y-4 > * + * {
        margin-top: 0.5rem !important;
    }

    .space-x-6 > * + * {
        margin-left: 0.5rem !important;
    }

    .space-x-4 > * + * {
        margin-left: 0.375rem !important;
    }
}

@media (max-width: 480px) {
    /* Extra small screens adjustments */
    .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* Force single column everywhere */
    .sm\\:grid-cols-2 {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }

    .md\\:grid-cols-3 {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }

    .lg\\:grid-cols-4 {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }

    /* Ultra compact spacing */
    .py-24 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }

    .py-16 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    .py-12 {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }

    .px-8 {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    .px-6 {
        padding-left: 0.375rem !important;
        padding-right: 0.375rem !important;
    }

    /* Compact buttons */
    .btn-primary, .btn-secondary {
        padding: 0.625rem 1rem !important;
        font-size: 0.825rem !important;
        width: 100% !important;
    }

    /* Text size for very small screens */
    .text-8xl {
        font-size: 2rem !important;
    }

    .text-7xl {
        font-size: 1.875rem !important;
    }

    .text-6xl {
        font-size: 1.75rem !important;
    }

    .text-5xl {
        font-size: 1.5rem !important;
    }

    .text-4xl {
        font-size: 1.25rem !important;
    }

    .text-3xl {
        font-size: 1.125rem !important;
    }

    .text-2xl {
        font-size: 1rem !important;
    }
}

/* Landscape phone adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .py-24 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    .py-16 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }

    .text-8xl, .text-7xl, .text-6xl {
        font-size: 2rem !important;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    button, .btn-primary, .btn-secondary, a[class*="btn"] {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem 1rem;
    }

    /* Larger interactive elements */
    input, select, textarea {
        min-height: 44px;
        padding: 0.75rem;
    }

    /* Remove hover effects on touch devices */
    .hover\\:scale-105:hover {
        transform: none !important;
    }

    .hover\\:shadow-lg:hover {
        box-shadow: none !important;
    }

    .group:hover .group-hover\\:scale-110 {
        transform: none !important;
    }
}

/* Dark theme adjustments */
@media (prefers-color-scheme: dark) {
    /* Additional dark theme styles if needed */
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

/* Line clamp utility classes */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Aspect ratio utilities */
.aspect-video {
    aspect-ratio: 16 / 9;
}

/* Enhanced card styles */
.card {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.9), rgba(17, 24, 39, 0.9));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(231, 129, 61, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Prose styling for article content */
.prose {
    color: #d1d5db;
    line-height: 1.75;
}

.prose h1, .prose h2, .prose h3, .prose h4 {
    color: #ffffff;
    font-weight: bold;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.prose p {
    margin-bottom: 1em;
}

.prose strong {
    color: #ffffff;
    font-weight: 600;
}

.prose a {
    color: #e7813d;
    text-decoration: underline;
}

.prose a:hover {
    color: #ea580c;
}

/* Button styles */
.btn-primary {
    background: linear-gradient(135deg, #e7813d, #ea580c);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #ea580c, #c2410c);
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(231, 129, 61, 0.3);
}

.btn-secondary {
    background: rgba(75, 85, 99, 0.5);
    color: #d1d5db;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(75, 85, 99, 0.5);
}

.btn-secondary:hover {
    background: rgba(75, 85, 99, 0.8);
    color: white;
    border-color: #e7813d;
}

/* Glassmorphism effects */
.backdrop-blur-sm {
    backdrop-filter: blur(4px);
}

.backdrop-blur-md {
    backdrop-filter: blur(12px);
}

.backdrop-blur-lg {
    backdrop-filter: blur(16px);
}

.backdrop-blur-xl {
    backdrop-filter: blur(24px);
}

.backdrop-blur-2xl {
    backdrop-filter: blur(40px);
}

.backdrop-blur-3xl {
    backdrop-filter: blur(64px);
}

/* Enhanced blur utilities */
.blur-xl {
    filter: blur(20px);
}

.blur-2xl {
    filter: blur(40px);
}

.blur-3xl {
    filter: blur(64px);
}

/* Glass card enhanced styles */
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(231, 129, 61, 0.3);
    transform: translateY(-2px);
}

/* Enhanced smooth scrolling */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 2rem;
}

/* Modern gradient text */
.gradient-text {
    background: linear-gradient(135deg, #e7813d, #ea580c, #f97316);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Floating animations */
@keyframes float-slow {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(1deg); }
    50% { transform: translateY(-15px) rotate(0deg); }
    75% { transform: translateY(-10px) rotate(-1deg); }
}

.animate-float-slow {
    animation: float-slow 6s ease-in-out infinite;
}

/* Pulse glow effect */
@keyframes pulse-glow {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(231, 129, 61, 0.3);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 40px rgba(231, 129, 61, 0.6);
        transform: scale(1.05);
    }
}

.animate-pulse-glow {
    animation: pulse-glow 3s ease-in-out infinite;
}

/* Animated border effects */
@keyframes border-pulse {
    0%, 100% {
        background: linear-gradient(45deg, rgba(231, 129, 61, 0.3), rgba(255, 255, 255, 0.2), rgba(234, 88, 12, 0.3));
        transform: scale(1);
    }
    50% {
        background: linear-gradient(45deg, rgba(231, 129, 61, 0.5), rgba(255, 255, 255, 0.3), rgba(234, 88, 12, 0.5));
        transform: scale(1.02);
    }
}

.animate-border-pulse {
    animation: border-pulse 4s ease-in-out infinite;
}

/* Enhanced glassmorphism container */
.glass-hero {
    backdrop-filter: blur(20px) saturate(180%);
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.125);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-hero:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(231, 129, 61, 0.3);
    transform: translateY(-2px);
}

/* Gradient border animation */
@keyframes gradient-border {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animate-gradient-border {
    background: linear-gradient(
        45deg,
        rgba(231, 129, 61, 0.4),
        rgba(255, 255, 255, 0.2),
        rgba(234, 88, 12, 0.4),
        rgba(255, 255, 255, 0.2)
    );
    background-size: 400% 400%;
    animation: gradient-border 3s ease infinite;
}

/* === RESPONSIVE ENHANCEMENTS FOR SPECIFIC COMPONENTS === */

/* Navigation responsive enhancements */
@media (max-width: 1024px) {
    /* Navigation adjustments for tablets */
    nav .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .hidden.lg\\:flex {
        gap: 0.5rem;
    }

    nav a span {
        font-size: 0.9rem;
    }
}

/* Card component responsive enhancements */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
        border-radius: 0.75rem;
    }

    .card:hover {
        transform: translateY(-1px) scale(1.01);
    }

    /* Glass card mobile adjustments */
    .glass-card {
        backdrop-filter: blur(15px);
        background: rgba(255, 255, 255, 0.12);
    }

    /* Modal adjustments for mobile */
    .modal-content {
        margin: 0.5rem;
        max-height: 90vh;
        width: calc(100% - 1rem);
    }

    /* Forum styles mobile */
    .forum-category, .forum-topic {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }

    /* Tournament bracket mobile */
    .bracket {
        flex-direction: column;
        gap: 1rem;
    }

    .bracket-round {
        min-height: auto;
    }

    .bracket-match {
        min-width: auto;
        width: 100%;
    }
}

/* Form and input responsive enhancements */
@media (max-width: 640px) {
    .form-input {
        padding: 0.75rem;
        font-size: 1rem; /* Prevent zoom on iOS */
    }

    .form-label {
        font-size: 0.9rem;
    }

    /* Badge adjustments */
    .badge {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }

    /* Progress bar mobile */
    .progress-bar {
        height: 0.5rem;
    }

    .progress-fill {
        height: 0.5rem;
    }

    /* Rating stars mobile */
    .rating .star {
        font-size: 1.125rem;
        margin: 0 0.125rem;
    }
}

/* Mobile-first table responsive */
@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        width: 100%;
    }

    thead {
        display: none;
    }

    tr {
        display: block;
        border-bottom: 1px solid rgba(75, 85, 99, 0.3);
        margin-bottom: 0.5rem;
        padding: 0.75rem;
        background: rgba(31, 41, 55, 0.5);
        border-radius: 0.5rem;
    }

    td {
        display: block;
        text-align: left;
        padding: 0.25rem 0;
        border: none;
    }

    td:before {
        content: attr(data-label) ": ";
        font-weight: bold;
        color: rgba(156, 163, 175, 1);
        text-transform: uppercase;
        font-size: 0.75rem;
    }
}

/* Hero section mobile enhancements */
@media (max-width: 768px) {
    /* Background positioning for mobile */
    .fixed.inset-0 div[style*="background-image"] {
        background-attachment: scroll !important;
        background-position: center top !important;
    }

    /* Hero text adjustments */
    .bg-gradient-to-r.from-primary {
        background-size: 200% 200% !important;
        animation: gradient-shift 4s ease infinite;
    }
}

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

/* Server list mobile responsive */
@media (max-width: 640px) {
    .server-card {
        padding: 0.75rem;
    }

    .server-info {
        flex-direction: column;
        gap: 0.5rem;
    }

    .server-players {
        justify-self: start;
        margin-top: 0.5rem;
    }
}

/* Chat mobile responsive */
@media (max-width: 768px) {
    #chatMessages {
        max-height: 300px;
        padding: 0.75rem;
    }

    .chat-message {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
        border-radius: 0.5rem;
    }

    .chat-input {
        padding: 0.75rem;
        font-size: 1rem; /* Prevent zoom on iOS */
    }
}

/* News/Article mobile responsive */
@media (max-width: 768px) {
    .prose {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .prose h1, .prose h2, .prose h3, .prose h4 {
        font-size: 1.25rem;
        margin-top: 1rem;
        margin-bottom: 0.5rem;
    }

    .prose p {
        margin-bottom: 0.75rem;
    }

    .prose img {
        max-width: 100%;
        height: auto;
        border-radius: 0.5rem;
    }
}

/* Download section mobile */
@media (max-width: 640px) {
    .download-card {
        padding: 1rem;
    }

    .download-info {
        text-align: center;
    }

    .download-stats {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

/* Profile page mobile */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .profile-avatar {
        align-self: center;
    }

    .profile-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .profile-stats {
        grid-template-columns: 1fr;
    }
}

/* Admin panel mobile */
@media (max-width: 768px) {
    .admin-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        height: 100vh;
        width: 280px;
        z-index: 1000;
        transition: left 0.3s ease;
        background: rgba(17, 24, 39, 0.95);
        backdrop-filter: blur(20px);
    }

    .admin-sidebar.open {
        left: 0;
    }

    .admin-content {
        margin-left: 0;
        padding: 1rem;
    }

    .admin-mobile-toggle {
        display: block;
    }
}

/* Utilities for improved mobile experience */
.touch-manipulation {
    touch-action: manipulation;
}

.scroll-smooth {
    scroll-behavior: smooth;
}

.overscroll-none {
    overscroll-behavior: none;
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .fixed.inset-0 {
        position: absolute;
    }

    body {
        padding-bottom: env(safe-area-inset-bottom);
    }

    input, select, textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Android Chrome specific fixes */
@media screen and (max-width: 767px) {
    .viewport-fix {
        min-height: 100vh;
        min-height: calc(var(--vh, 1vh) * 100);
    }
}

/* High DPI display adjustments */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .crisp-edges {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Accessibility improvements for mobile */
@media (max-width: 768px) {
    /* Larger focus indicators */
    button:focus, a:focus, input:focus, select:focus, textarea:focus {
        outline: 3px solid rgba(231, 129, 61, 0.6);
        outline-offset: 2px;
    }

    /* Skip to content link for mobile */
    .skip-to-content {
        position: absolute;
        top: -40px;
        left: 6px;
        background: #000;
        color: white;
        padding: 8px;
        text-decoration: none;
        border-radius: 4px;
        transition: top 0.3s ease;
    }

    .skip-to-content:focus {
        top: 6px;
    }
}

/* === EXTREME MOBILE FIXES FOR SPECIFIC PAGES === */

/* Fix for forms that are too wide */
@media (max-width: 480px) {
    /* Ensure all containers respect viewport width */
    * {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Fix wide elements that might overflow */
    .w-full {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Fix padding that causes overflow */
    .px-8 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .px-6 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .px-4 {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* Fix margins that cause overflow */
    .mx-auto {
        margin-left: auto !important;
        margin-right: auto !important;
        max-width: 100% !important;
    }

    /* Specific table fixes */
    table, .table {
        width: 100% !important;
        display: block !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Fix for server cards that might be too wide */
    .server-card,
    .bg-white\/5,
    .bg-gray-800 {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }

    /* Fix for forms */
    .max-w-md {
        max-width: 100% !important;
        margin-left: 0.5rem !important;
        margin-right: 0.5rem !important;
    }

    .max-w-lg {
        max-width: 100% !important;
        margin-left: 0.5rem !important;
        margin-right: 0.5rem !important;
    }

    .max-w-xl {
        max-width: 100% !important;
        margin-left: 0.5rem !important;
        margin-right: 0.5rem !important;
    }

    .max-w-2xl {
        max-width: 100% !important;
        margin-left: 0.5rem !important;
        margin-right: 0.5rem !important;
    }

    /* Fix for long text that doesn't wrap */
    .server-address,
    .font-mono {
        word-break: break-all !important;
        font-size: 0.8rem !important;
    }

    /* Fix for buttons in mobile */
    button,
    .btn-primary,
    .btn-secondary,
    a[role="button"] {
        width: 100% !important;
        margin-bottom: 0.5rem !important;
        min-height: 48px !important;
        font-size: 1rem !important;
        touch-action: manipulation !important;
    }

    /* Fix for grids that might overflow */
    .grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* Special grid exceptions for stats */
    .grid.grid-cols-3 {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .grid.grid-cols-2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Fix for flex items that don't wrap properly */
    .flex {
        flex-wrap: wrap !important;
    }

    .flex-row {
        flex-direction: column !important;
    }

    .space-x-4 > * + * {
        margin-left: 0 !important;
        margin-top: 0.5rem !important;
    }

    .space-x-6 > * + * {
        margin-left: 0 !important;
        margin-top: 0.75rem !important;
    }

    /* Fix for modals on small screens */
    .fixed.inset-0 > div {
        margin: 0.5rem !important;
        max-width: calc(100vw - 1rem) !important;
        max-height: calc(100vh - 1rem) !important;
    }

    /* Fix for progress bars */
    .w-32 {
        width: 100% !important;
        max-width: 8rem !important;
    }

    /* Ensure text doesn't overflow */
    .text-3xl,
    .text-4xl,
    .text-5xl {
        word-wrap: break-word !important;
        hyphens: auto !important;
    }
}

/* Ultra small screens (less than 360px) */
@media (max-width: 360px) {
    .container,
    .max-w-7xl {
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }

    .text-4xl {
        font-size: 1.5rem !important;
    }

    .text-3xl {
        font-size: 1.25rem !important;
    }

    .text-2xl {
        font-size: 1.125rem !important;
    }

    .p-6 {
        padding: 0.5rem !important;
    }

    .p-8 {
        padding: 0.5rem !important;
    }

    .mb-8 {
        margin-bottom: 1rem !important;
    }

    .mb-6 {
        margin-bottom: 0.75rem !important;
    }
}

/* Landscape mobile orientation fixes */
@media (max-height: 500px) and (orientation: landscape) {
    .min-h-screen {
        min-height: 100vh !important;
    }

    .py-12 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    .py-8 {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }

    .mb-8 {
        margin-bottom: 1rem !important;
    }

    .space-y-8 > * + * {
        margin-top: 1rem !important;
    }
}

/* Fix for iOS safe area */
@supports(padding: max(0px)) {
    .container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    body {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

/* Force hardware acceleration on mobile for better performance */
@media (hover: none) {
    * {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
}