/* Mobile-first responsive styles for Planning Poker */

/* Base mobile optimizations */
@media (max-width: 640px) {
    /* Improve touch targets */
    .vote-card {
        min-height: 60px;
        min-width: 60px;
    }
    
    /* Better spacing for mobile */
    .space-y-6 > * + * {
        margin-top: 1rem;
    }
    
    /* Improve button sizes for touch */
    button {
        min-height: 44px;
    }
    
    /* Better text sizing for mobile */
    .text-3xl {
        font-size: 1.5rem;
        line-height: 2rem;
    }
    
    .text-2xl {
        font-size: 1.25rem;
        line-height: 1.75rem;
    }
    
    /* Improve form inputs */
    input[type="text"] {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Better modal sizing */
    .fixed.inset-0 .bg-white {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
    
    /* Improve grid layouts for mobile */
    .grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.5rem;
    }
    
    /* Better participant cards on mobile */
    .flip-card {
        height: 120px;
    }
    
    .flip-card-front, .flip-card-back {
        padding: 0.75rem;
    }
    
    /* Improve navigation on mobile */
    .flex.items-center.space-x-2 {
        gap: 0.5rem;
    }
    
    /* Better room info display */
    .flex.flex-wrap.items-center.gap-4 {
        gap: 0.5rem;
    }
    
    /* Improve action buttons */
    .flex.flex-col.sm\\:flex-row {
        gap: 0.75rem;
    }
}

/* Tablet optimizations */
@media (min-width: 641px) and (max-width: 1024px) {
    /* Better grid layouts for tablets */
    .grid-cols-3 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

/* Improve touch interactions */
@media (hover: none) and (pointer: coarse) {
    /* Better touch feedback */
    .vote-card:hover {
        transform: none;
    }
    
    .vote-card:active {
        transform: scale(0.95);
    }
    
    /* Improve button feedback */
    button:active {
        transform: scale(0.98);
    }
}

/* Improve accessibility on mobile */
@media (max-width: 640px) {
    /* Better focus indicators */
    .focus\\:ring-2:focus {
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
    }
    
    /* Better contrast for small text */
    .text-gray-500 {
        color: rgb(107 114 128);
    }
    
    .text-gray-600 {
        color: rgb(75 85 99);
    }
}

/* Landscape mobile optimizations */
@media (max-width: 896px) and (orientation: landscape) {
    /* Reduce vertical spacing in landscape */
    .space-y-6 > * + * {
        margin-top: 0.75rem;
    }
    
    /* Better use of horizontal space */
    .grid-cols-3 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    
    /* Reduce padding in landscape */
    .p-6 {
        padding: 1rem;
    }
}

/* High DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Ensure crisp borders on high DPI displays */
    .border-2 {
        border-width: 1px;
    }
    
    /* Better icon rendering */
    svg {
        shape-rendering: geometricPrecision;
    }
}

/* Dark mode support (if needed in future) */
@media (prefers-color-scheme: dark) {
    /* This can be expanded if dark mode is implemented */
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .transition {
        transition: none;
    }
    
    .duration-200 {
        transition-duration: 0s;
    }
    
    .animate-spin {
        animation: none;
    }
}

/* Room cards mobile optimizations */
@media (max-width: 640px) {
    /* Ensure room cards don't overflow */
    .border-2.border-gray-200.rounded-lg {
        overflow: hidden;
    }
    
    /* Better button spacing on mobile */
    .flex.flex-col.sm\\:flex-row.gap-2 {
        gap: 0.5rem;
    }
    
    /* Ensure buttons don't shrink too much */
    .flex-shrink-0 {
        flex-shrink: 0;
    }
    
    /* Better text wrapping for room info */
    .flex.flex-wrap.items-center.gap-2 {
        gap: 0.5rem;
    }
    
    /* Hide separators on mobile for cleaner look */
    .hidden.sm\\:inline {
        display: none;
    }
}

/* Tablet optimizations for room cards */
@media (min-width: 641px) and (max-width: 1024px) {
    /* Better spacing for tablet */
    .flex.flex-col.sm\\:flex-row.gap-2 {
        gap: 0.75rem;
    }
}

/* Print styles */
@media print {
    .bg-gradient-to-br {
        background: white !important;
    }
    
    .shadow-lg, .shadow-md, .shadow-sm {
        box-shadow: none !important;
    }
    
    .text-primary {
        color: black !important;
    }
}
