/* Custom styles for Infinitely Better Craft */

/* Mobile-first responsive design */
@media (max-width: 640px) {
    .element-card {
        padding: 0.75rem !important;
    }
    
    .combine-slot {
        width: 4rem !important;
        height: 4rem !important;
    }
    
    #combine-area {
        padding: 1rem !important;
    }
    
    .text-2xl {
        font-size: 1.5rem !important;
    }
}

/* Enhanced touch targets for mobile */
.element-card, 
.combine-slot, 
button {
    min-height: 44px;
    min-width: 44px;
}

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

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

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

::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Focus states for accessibility */
button:focus,
input:focus,
.element-card:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Loading spinner enhancement */
.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Gradient backgrounds for different element types */
.element-card[data-element-type="fire"] {
    background: linear-gradient(135deg, #dc2626, #991b1b);
}

.element-card[data-element-type="water"] {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.element-card[data-element-type="earth"] {
    background: linear-gradient(135deg, #16a34a, #15803d);
}

.element-card[data-element-type="air"] {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

/* Dark mode optimizations */
@media (prefers-color-scheme: dark) {
    body {
        color-scheme: dark;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .element-card {
        border: 2px solid white;
    }
    
    .element-card.selected {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px #3b82f6;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .element-card,
    .combine-animation,
    .discovery-animation {
        animation: none !important;
        transition: none !important;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
}

/* PWA safe area insets for notched phones */
body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Better button states */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

button:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

button:not(:disabled):active {
    transform: translateY(0);
}

/* Enhanced grid layout */
.elements-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

@media (max-width: 640px) {
    .elements-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* Notification enhancements */
.notification {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Loading overlay */
#loading-overlay {
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}