@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
    --blue-primary: #3b82f6;
    --red-primary: #ef4444;
    --bg-dark: #05070a;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.glass-panel {
    background: rgba(5, 7, 10, 0.4);
    -webkit-backdrop-filter: blur(40px);
    backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.hud-border {
    position: relative;
}

.hud-border::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 10px;
    height: 10px;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    border-left: 2px solid rgba(255, 255, 255, 0.2);
}

.tactical-card {
    background: #05070a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

#cardA {
    background: linear-gradient(to bottom left, rgba(59, 130, 246, 0.15) 0%, #05070a 40%);
}

#cardB {
    background: linear-gradient(to top right, rgba(239, 68, 68, 0.15) 0%, #05070a 40%);
}

.tactical-card-inner {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    border-radius: inherit;
}

.corner-accent {
    position: absolute;
    width: 8px;
    height: 8px;
    border-color: rgba(255, 255, 255, 0.2);
    border-style: solid;
    pointer-events: none;
    z-index: 10;
}

.corner-tl {
    top: 0;
    left: 0;
    border-width: 2px 0 0 2px;
}

.corner-tr {
    top: 0;
    right: 0;
    border-width: 2px 2px 0 0;
}

.corner-bl {
    bottom: 0;
    left: 0;
    border-width: 0 0 2px 2px;
}

.corner-br {
    bottom: 0;
    right: 0;
    border-width: 0 2px 2px 0;
}

.vs-glow {
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
    animation: vs-pulse 2s ease-in-out infinite;
}

@keyframes vs-pulse {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

.scanline {
    width: 100%;
    height: 100px;
    z-index: 1;
    background: linear-gradient(0deg,
            rgba(0, 0, 0, 0) 0%,
            rgba(255, 255, 255, 0.02) 50%,
            rgba(0, 0, 0, 0) 100%);
    opacity: 0.1;
    position: absolute;
    bottom: 100%;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% {
        bottom: 100%;
    }

    100% {
        bottom: -100px;
    }
}

/* Dropdown Styling */
.dropdown-menu {
    position: absolute;
    inset: 0;
    background: rgba(10, 15, 25, 0.98);
    -webkit-backdrop-filter: blur(30px);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: inherit;
    z-index: 100;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    animation: dropdown-fade-scale 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.dropdown-list {
    flex: 1;
    overflow-y: auto;
}

.dropdown-list::-webkit-scrollbar {
    width: 4px;
}

.dropdown-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.dropdown-item {
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    padding-left: 25px;
    box-shadow: inset 4px 0 0 #3b82f6;
}

#dropdownB .dropdown-item:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    box-shadow: inset 4px 0 0 #ef4444;
}

.dropdown-item.active {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

#dropdownB .dropdown-item.active {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

@keyframes dropdown-fade-scale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animations */
@keyframes loading-bar {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slide-in-bottom {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.animate-slide-up {
    animation: slide-in-bottom 0.8s ease-out forwards;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #05070a;
}

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

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

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Mobile Optimizations */
/* Holographic Button */
.holographic-btn {
    background: rgba(5, 7, 10, 0.6);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.holographic-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.holographic-btn:hover::before {
    transform: translateX(100%);
}

.holographic-btn:hover {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

.holographic-btn:active {
    transform: translateY(0) scale(0.98);
}

.holographic-btn .btn-glow {
    position: absolute;
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.4) 0%, transparent 70%);
    filter: blur(10px);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.holographic-btn:hover .btn-glow {
    opacity: 1;
}

/* Red Alert Override for Card B */
#cardB.tactical-card:hover {
    border-color: rgba(239, 68, 68, 0.3) !important;
    box-shadow: 0 0 50px rgba(239, 68, 68, 0.1) !important;
}

#cardB .corner-accent {
    border-color: rgba(239, 68, 68, 0.5) !important;
}

#cardB .vs-glow {
    text-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

@media (max-width: 768px) {
    .glass-panel {
        padding: 1.25rem !important;
    }

    body {
        font-size: 14px;
    }
}

@media (max-width: 640px) {
    main {
        padding-top: 1.5rem !important;
    }

    h2 {
        line-height: 1.1;
    }
}