/* Responsive Design Improvements */

/* Mobile First Approach */
@media (max-width: 640px) {
    /* Sidebar adjustments for mobile */
    .sidebar-shadow {
        box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    }
    
    /* Sidebar transitions */
    .sidebar-transition {
        transition: transform 0.3s ease-in-out;
    }
    
    /* Prevent body scroll when sidebar is open */
    body.sidebar-open {
        overflow: hidden;
    }
    
    /* Sidebar overlay */
    #sidebar-overlay {
        transition: opacity 0.3s ease-in-out;
    }
    
    /* Mobile menu button */
    #mobile-menu-button {
        transition: all 0.2s ease-in-out;
    }
    
    #mobile-menu-button:hover {
        background-color: rgba(0, 0, 0, 0.05);
    }
    
    /* Header adjustments */
    .header-mobile {
        padding: 0.75rem 1rem;
    }
    
    /* Page title adjustments */
    .page-title-mobile {
        font-size: 1.125rem;
        line-height: 1.5rem;
    }
    
    .page-subtitle-mobile {
        font-size: 0.75rem;
        line-height: 1rem;
    }
    
    /* Stats cards adjustments */
    .stats-card-mobile {
        padding: 1rem;
    }
    
    .stats-card-mobile .text-2xl {
        font-size: 1.5rem;
        line-height: 2rem;
    }
    
    /* Form adjustments */
    .form-mobile {
        padding: 1rem;
    }
    
    .form-mobile .space-y-4 > * + * {
        margin-top: 0.75rem;
    }
    
    /* Modal adjustments */
    .modal-mobile {
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
    }
    
    .modal-mobile .p-6 {
        padding: 1rem;
    }
    
    /* Table adjustments */
    .table-mobile {
        font-size: 0.875rem;
    }
    
    .table-mobile th,
    .table-mobile td {
        padding: 0.5rem 0.25rem;
    }
    
    /* Button adjustments */
    .btn-mobile {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Input adjustments */
    .input-mobile {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Map adjustments */
    .map-mobile {
        height: 16rem;
    }
    
    /* List adjustments */
    .list-mobile {
        max-height: 12rem;
    }
}

/* Tablet adjustments */
@media (min-width: 641px) and (max-width: 1024px) {
    /* Grid adjustments for tablet */
    .grid-tablet-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .grid-tablet-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    
    /* Stats cards for tablet */
    .stats-card-tablet {
        padding: 1.25rem;
    }
    
    /* Modal adjustments for tablet */
    .modal-tablet {
        max-width: 42rem;
    }
    
    /* Map adjustments for tablet */
    .map-tablet {
        height: 20rem;
    }
}

/* Desktop adjustments */
@media (min-width: 1025px) {
    /* Grid adjustments for desktop */
    .grid-desktop-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    
    /* Stats cards for desktop */
    .stats-card-desktop {
        padding: 1.5rem;
    }
    
    /* Modal adjustments for desktop */
    .modal-desktop {
        max-width: 48rem;
    }
    
    /* Map adjustments for desktop */
    .map-desktop {
        height: 24rem;
    }
}

/* Extra small devices (phones in portrait) */
@media (max-width: 480px) {
    /* Very small adjustments */
    .text-xs-mobile {
        font-size: 0.75rem;
        line-height: 1rem;
    }
    
    .p-xs-mobile {
        padding: 0.5rem;
    }
    
    .space-y-xs-mobile > * + * {
        margin-top: 0.5rem;
    }
    
    /* Hide some elements on very small screens */
    .hide-xs {
        display: none;
    }
    
    /* Stack elements vertically */
    .stack-xs {
        flex-direction: column;
    }
    
    .stack-xs > * + * {
        margin-top: 0.5rem;
        margin-left: 0;
    }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    /* Reduce padding for landscape mobile */
    .landscape-mobile {
        padding: 0.5rem;
    }
    
    /* Reduce modal height */
    .modal-landscape {
        max-height: calc(100vh - 0.5rem);
    }
    
    /* Reduce map height */
    .map-landscape {
        height: 12rem;
    }
}

/* Print styles */
@media print {
    /* Hide sidebar and header when printing */
    .sidebar-print,
    .header-print {
        display: none !important;
    }
    
    /* Adjust main content for print */
    .main-print {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Ensure text is readable */
    .print-text {
        color: black !important;
        background: white !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    /* Increase contrast for better accessibility */
    .high-contrast {
        border-color: #000000;
        color: #000000;
    }
    
    .high-contrast-bg {
        background-color: #ffffff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    /* Disable animations for users who prefer reduced motion */
    .no-motion {
        transition: none !important;
        animation: none !important;
    }
    
    .no-motion * {
        transition: none !important;
        animation: none !important;
    }
}

/* Dark mode support (if implemented) */
@media (prefers-color-scheme: dark) {
    .dark-mode {
        background-color: #1f2937;
        color: #f9fafb;
    }
    
    .dark-mode .bg-white {
        background-color: #374151;
    }
    
    .dark-mode .text-gray-900 {
        color: #f9fafb;
    }
    
    .dark-mode .text-gray-600 {
        color: #d1d5db;
    }
}

/* Utility classes for responsive design */
.responsive-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .responsive-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .responsive-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Feriados page specific responsive styles */
@media (max-width: 640px) {
    /* Feriados page mobile adjustments */
    .feriados-mobile {
        padding: 1rem;
    }
    
    .feriados-mobile .stats-card {
        padding: 1rem;
    }
    
    .feriados-mobile .stats-card .text-2xl {
        font-size: 1.25rem;
        line-height: 1.75rem;
    }
    
    .feriados-mobile .stats-card .text-sm {
        font-size: 0.75rem;
        line-height: 1rem;
    }
    
    .feriados-mobile .filter-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .feriados-mobile .holiday-list {
        max-height: 16rem;
    }
    
    .feriados-mobile .pagination {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .feriados-mobile .pagination button {
        width: 100%;
        justify-content: center;
    }
}

/* Floating Action Buttons (FAB) for mobile */
.fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 50;
    border: none;
    cursor: pointer;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.fab:active {
    transform: scale(0.95);
}

/* FAB colors */
.fab-blue {
    background-color: #2563eb;
    color: white;
}

.fab-blue:hover {
    background-color: #1d4ed8;
}

.fab-green {
    background-color: #059669;
    color: white;
}

.fab-green:hover {
    background-color: #047857;
}

/* Hide FAB on desktop */
@media (min-width: 768px) {
    .fab {
        display: none !important;
    }
}

/* FAB animations */
@keyframes fabPulse {
    0% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 8px rgba(37, 99, 235, 0.1);
    }
    100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
}

.fab-pulse {
    animation: fabPulse 2s infinite;
}

.responsive-flex {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 640px) {
    .responsive-flex {
        flex-direction: row;
        align-items: center;
    }
}

.responsive-text {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

@media (min-width: 640px) {
    .responsive-text {
        font-size: 1rem;
        line-height: 1.5rem;
    }
}

.responsive-padding {
    padding: 1rem;
}

@media (min-width: 640px) {
    .responsive-padding {
        padding: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .responsive-padding {
        padding: 2rem;
    }
}
