/* ========================================
   RESPONSIVE STYLES - AGENDA MAX
   ======================================== */

/* Base responsive utilities */
.container-fluid {
    padding-left: 15px;
    padding-right: 15px;
}

/* Mobile First Approach - Dispositivos Móveis Modernos */

/* iPhone XR, Samsung S20, etc. (414px - 428px) */
@media (max-width: 428px) {
    /* Typography adjustments */
    .display-3 {
        font-size: 2rem !important;
        line-height: 1.2;
    }
    
    .display-4 {
        font-size: 1.75rem !important;
        line-height: 1.2;
    }
    
    .lead {
        font-size: 0.9rem !important;
        line-height: 1.4;
    }
    
    /* Button adjustments */
    .btn-lg {
        padding: 0.5rem 1rem !important;
        font-size: 0.9rem !important;
        min-height: 44px;
    }
    
    .btn {
        min-height: 44px;
        font-size: 0.9rem;
    }
    
    /* Card adjustments */
    .card-body {
        padding: 0.75rem !important;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    /* Form adjustments */
    .form-control-lg {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.9rem !important;
        min-height: 44px;
    }
    
    .form-control {
        min-height: 44px;
        font-size: 0.9rem;
    }
    
    /* Header adjustments */
    .cabesalho {
        padding: 8px 10px !important;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .logo img {
        width: 60px !important;
        height: 60px !important;
    }
    
    .menu {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }
    
    .menu a {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
    
    .botoes {
        order: 2;
        width: 100%;
        justify-content: center;
        gap: 8px;
    }
    
    .botoes a {
        font-size: 0.8rem;
        padding: 6px 12px;
        min-height: 36px;
    }
    
    /* Video background adjustments */
    .video-background {
        min-height: 40vh !important;
    }
    
    /* Admin dashboard adjustments */
    .admin-container {
        padding: 0.5rem !important;
    }
    
    .stat-card .display-4 {
        font-size: 2rem !important;
    }
    
    /* Estabelecimento cards */
    .estabelecimento-card .card-img-top {
        height: 120px !important;
    }
    
    /* Action buttons */
    .btn-group {
        flex-direction: column !important;
        width: 100%;
    }
    
    .btn-group .btn {
        border-radius: 0.375rem !important;
        margin-bottom: 0.25rem;
        width: 100%;
    }
    
    /* Container adjustments */
    .container-fluid {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
    
    /* Grid adjustments */
    .row {
        margin-left: -4px;
        margin-right: -4px;
    }
    
    .col-12 {
        padding-left: 4px;
        padding-right: 4px;
    }
    
    /* Text adjustments */
    h1, h2, h3, h4, h5, h6 {
        line-height: 1.2;
    }
    
    p {
        line-height: 1.4;
    }
    
    /* Classes específicas para mobile */
    .input-group-sm {
        height: 44px;
    }
    
    .form-control-sm {
        height: 44px;
        font-size: 0.9rem;
    }
    
    .btn-sm {
        min-height: 36px;
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    
    .h4-lg {
        font-size: 1.25rem;
    }
    
    .small {
        font-size: 0.75rem;
    }
    
    /* Espaçamento mobile */
    .px-2 {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    .py-2 {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }
    
    .mb-2 {
        margin-bottom: 0.5rem !important;
    }
    
    .mb-3 {
        margin-bottom: 0.75rem !important;
    }
    
    .rounded-3 {
        border-radius: 0.5rem !important;
    }
    
    /* Classes específicas para mobile */
    .fs-6-mobile {
        font-size: 0.9rem !important;
    }
    
    .small-md-normal {
        font-size: 0.75rem !important;
    }
    
    .fs-5 {
        font-size: 0.9rem !important;
    }
    
    .fs-md-4 {
        font-size: 1.25rem !important;
    }
    
    .px-4 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .py-2 {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }
    
    .g-2 {
        --bs-gutter-x: 0.5rem;
        --bs-gutter-y: 0.5rem;
    }
    
    .mb-4 {
        margin-bottom: 1rem !important;
    }
    
    .mb-md-5 {
        margin-bottom: 1rem !important;
    }
    
    .me-2 {
        margin-right: 0.5rem !important;
    }
    
    .me-md-3 {
        margin-right: 0.5rem !important;
    }
}

/* Dispositivos móveis pequenos (até 375px) */
@media (max-width: 375px) {
    .display-3 {
        font-size: 1.75rem !important;
    }
    
    .display-4 {
        font-size: 1.5rem !important;
    }
    
    .logo img {
        width: 50px !important;
        height: 50px !important;
    }
    
    .btn-lg {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.8rem !important;
    }
    
    .form-control-lg {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.8rem !important;
    }
    
    .card-body {
        padding: 0.5rem !important;
    }
    
    .admin-container {
        padding: 0.25rem !important;
    }
}

/* Dispositivos móveis médios (376px - 576px) */
@media (min-width: 376px) and (max-width: 576px) {
    .display-3 {
        font-size: 2.25rem !important;
    }
    
    .display-4 {
        font-size: 1.85rem !important;
    }
    
    .logo img {
        width: 70px !important;
        height: 70px !important;
    }
    
    .btn-lg {
        padding: 0.6rem 1.2rem !important;
        font-size: 0.95rem !important;
    }
    
    .form-control-lg {
        padding: 0.6rem 0.9rem !important;
        font-size: 0.95rem !important;
    }
}

/* Tablet adjustments */
@media (min-width: 577px) and (max-width: 768px) {
    .display-3 {
        font-size: 3rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .logo img {
        width: 100px;
        height: 100px;
    }
    
    .estabelecimento-card .card-img-top {
        height: 180px !important;
    }
}

/* Desktop adjustments */
@media (min-width: 769px) {
    .container-fluid {
        padding-left: 30px;
        padding-right: 30px;
    }
    
    .admin-container {
        padding: 2rem;
    }
}

/* Large desktop adjustments */
@media (min-width: 1200px) {
    .container-fluid {
        padding-left: 50px;
        padding-right: 50px;
    }
}

/* Print styles */
@media print {
    .cabesalho,
    .rodape,
    .btn,
    .action-buttons {
        display: none !important;
    }
    
    .container-fluid {
        padding: 0;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .btn-outline-primary {
        border-width: 2px;
    }
    
    .btn-outline-secondary {
        border-width: 2px;
    }
    
    .btn-outline-success {
        border-width: 2px;
    }
    
    .btn-outline-danger {
        border-width: 2px;
    }
    
    .btn-outline-info {
        border-width: 2px;
    }
    
    .btn-outline-warning {
        border-width: 2px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .logo img:hover {
        transform: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .card {
        background-color: #2d3748;
        color: #e2e8f0;
    }
    
    .text-muted {
        color: #a0aec0 !important;
    }
    
    .bg-light {
        background-color: #4a5568 !important;
    }
}

/* Focus styles for accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    outline: none;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

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

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Utility classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Responsive images */
.img-responsive {
    max-width: 100%;
    height: auto;
}

/* Responsive tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Responsive modals */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-content {
        border-radius: 0.5rem;
    }
}

/* Responsive forms */
@media (max-width: 576px) {
    .form-floating > .form-control {
        padding-top: 1.625rem;
        padding-bottom: 0.625rem;
    }
    
    .form-floating > label {
        padding: 1rem 0.75rem;
    }
}

/* Responsive navigation */
@media (max-width: 768px) {
    .navbar-toggler {
        border: none;
        padding: 0.25rem 0.5rem;
    }
    
    .navbar-collapse {
        margin-top: 1rem;
    }
}

/* Responsive spacing */
@media (max-width: 576px) {
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .mb-5 {
        margin-bottom: 2rem !important;
    }
    
    .mt-5 {
        margin-top: 2rem !important;
    }
}
