/* RF Spectrum Game Styles */

/* Draggable application items */
.application-item {
    padding: 12px 16px;
    margin: 8px 0;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: grab;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    user-select: none;
}

.application-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.application-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
    cursor: grabbing;
    z-index: 1000;
}

.application-item.matched {
    opacity: 0.3;
    pointer-events: none;
    background: #f3f4f6;
    border-color: #d1d5db;
}

/* Application icons */
.app-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
}

.app-icon.submarine { background: linear-gradient(135deg, #1e40af, #3b82f6); }
.app-icon.underground { background: linear-gradient(135deg, #7c2d12, #ea580c); }
.app-icon.geophysical { background: linear-gradient(135deg, #065f46, #10b981); }
.app-icon.navigation { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.app-icon.am-broadcast { background: linear-gradient(135deg, #dc2626, #ef4444); }
.app-icon.maritime { background: linear-gradient(135deg, #0369a1, #0ea5e9); }
.app-icon.shortwave { background: linear-gradient(135deg, #9333ea, #c084fc); }
.app-icon.aviation { background: linear-gradient(135deg, #0891b2, #06b6d4); }
.app-icon.wifi { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.app-icon.networks { background: linear-gradient(135deg, #16a34a, #22c55e); }
.app-icon.security { background: linear-gradient(135deg, #dc2626, #f87171); }
.app-icon.rfid { background: linear-gradient(135deg, #059669, #34d399); }

/* Frequency band slots */
.frequency-band {
    padding: 16px;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    transition: all 0.2s ease;
    position: relative;
}

.frequency-band.drag-over {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    border-style: solid;
}

.frequency-band.correct-drop {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    animation: correctMatch 0.6s ease;
}

.frequency-band.incorrect-drop {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    animation: incorrectMatch 0.6s ease;
}

.frequency-band.filled {
    border-style: solid;
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

/* Frequency band colors */
.band-elf { background: linear-gradient(135deg, #1e3a8a, #3b82f6); }
.band-slf { background: linear-gradient(135deg, #1e40af, #3b82f6); }
.band-ulf { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.band-vlf { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
.band-lf { background: linear-gradient(135deg, #06b6d4, #67e8f9); }
.band-mf { background: linear-gradient(135deg, #10b981, #34d399); }
.band-hf { background: linear-gradient(135deg, #84cc16, #a3e635); }
.band-vhf { background: linear-gradient(135deg, #eab308, #facc15); }
.band-uhf { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.band-shf { background: linear-gradient(135deg, #ef4444, #f87171); }

.frequency-band .band-label {
    font-weight: bold;
    font-size: 18px;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.frequency-band .band-range {
    font-size: 12px;
    color: white;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.frequency-band .band-indicator {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    margin-top: 8px;
}

/* Animations */
@keyframes correctMatch {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes incorrectMatch {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
    100% { transform: translateX(0); }
}

@keyframes scoreIncrease {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.score-animation {
    animation: scoreIncrease 0.4s ease;
}

/* Drag ghost image */
.drag-ghost {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.8;
    transform: rotate(5deg);
}

/* Success effects */
.success-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    pointer-events: none;
    animation: particleFloat 1s ease-out forwards;
}

@keyframes particleFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) scale(0);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .grid.lg\\:grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .frequency-band {
        min-height: 60px;
        padding: 12px;
    }
    
    .application-item {
        padding: 10px 12px;
    }
    
    .app-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.application-item:focus,
.frequency-band:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .application-item {
        border-width: 3px;
    }
    
    .frequency-band {
        border-width: 3px;
    }
}

/* Fireworks animation for game completion */
.firework {
    position: fixed;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
}

.firework-spark {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    pointer-events: none;
}

@keyframes fireworkLaunch {
    0% {
        transform: translateY(100vh);
        opacity: 1;
    }
    100% {
        transform: translateY(20vh);
        opacity: 0;
    }
}

@keyframes fireworkExplode {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

@keyframes sparkFly {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--spark-x), var(--spark-y)) scale(0);
        opacity: 0;
    }
}

.firework-launch {
    animation: fireworkLaunch 1s ease-out forwards;
}

.firework-explode {
    animation: fireworkExplode 0.5s ease-out forwards;
}

.firework-spark {
    animation: sparkFly 1s ease-out forwards;
}

/* Celebration overlay */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9998;
    background: radial-gradient(circle at center, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
}

/* Band tooltip styles */
#bandTooltip {
    max-width: 250px;
    font-size: 12px;
    line-height: 1.4;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: opacity 0.2s ease;
    white-space: pre-line;
}

#bandTooltip .font-bold {
    color: #fbbf24;
}

#tooltipApplications {
    white-space: pre-line;
    font-family: monospace;
    font-size: 11px;
}

/* Spectrum hover effects */
.spectrum-container:hover {
    cursor: crosshair;
}

/* Print styles */
@media print {
    .application-item.dragging,
    .drag-ghost,
    .success-particle,
    .firework,
    .firework-spark,
    .celebration-overlay,
    #bandTooltip {
        display: none !important;
    }
}