/* Responsive CSS - Sistema Imobiliário */

/* Mobile First - Base styles */
* {
    box-sizing: border-box;
}

/* Container responsivo */
.container-fluid {
    padding-left: 15px;
    padding-right: 15px;
}

/* Sidebar responsiva */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1050;
        position: fixed !important;
        top: 0;
        left: 0;
        height: 100vh;
        width: 250px;
        background: var(--sidebar-bg, #2c3e50);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .navbar-toggler {
        display: block !important;
        border: none;
        background: none;
        font-size: 1.5rem;
        color: white;
    }
    
    .navbar-toggler:focus {
        box-shadow: none;
    }
}

/* Tabelas responsivas */
@media (max-width: 992px) {
    .table-responsive {
        border-radius: 0.375rem;
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    }
    
    .table td, .table th {
        padding: 0.5rem 0.25rem;
        font-size: 0.875rem;
    }
    
    .btn-group .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .btn-group .btn i {
        font-size: 0.875rem;
    }
}

/* Cards responsivos */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .row.g-3 > * {
        margin-bottom: 1rem;
    }
}

/* Formulários responsivos */
@media (max-width: 576px) {
    .form-control, .form-select {
        font-size: 16px; /* Evita zoom no iOS */
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn-group {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
        border-radius: 0.375rem !important;
        margin-bottom: 2px;
    }
}

/* Paginação responsiva */
@media (max-width: 576px) {
    .pagination {
        font-size: 0.875rem;
    }
    
    .pagination .page-link {
        padding: 0.375rem 0.5rem;
    }
}

/* Alertas responsivos */
@media (max-width: 768px) {
    .alert-container {
        left: 10px;
        right: 10px;
        top: 10px;
        max-width: none;
    }
    
    .alert-custom {
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
    }
}

/* Modais responsivos */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-content {
        border-radius: 0.5rem;
    }
    
    .modal-header, .modal-body, .modal-footer {
        padding: 1rem;
    }
}

/* Breadcrumb responsivo */
@media (max-width: 768px) {
    .breadcrumb {
        font-size: 0.875rem;
        padding: 0.5rem 0;
    }
    
    .breadcrumb-item + .breadcrumb-item::before {
        content: "›";
    }
}

/* Navbar responsiva */
@media (max-width: 768px) {
    .navbar {
        padding: 0.5rem 1rem;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .navbar-nav {
        background: white;
        border-radius: 0.375rem;
        padding: 0.5rem;
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    }
}

/* Profile photo responsivo */
@media (max-width: 576px) {
    .profile-photo {
        width: 32px !important;
        height: 32px !important;
    }
    
    .profile-dropdown .dropdown-menu {
        min-width: 200px;
        right: 0;
        left: auto;
    }
}

/* Dashboards responsivos */
@media (max-width: 992px) {
    .dashboard-card {
        margin-bottom: 1rem;
    }
    
    .dashboard-stats {
        text-align: center;
    }
    
    .stats-row .col-md-3 {
        margin-bottom: 1rem;
    }
}

/* Filtros responsivos */
@media (max-width: 768px) {
    .filter-form .row {
        margin-bottom: 1rem;
    }
    
    .filter-form .col-md-4,
    .filter-form .col-md-2 {
        margin-bottom: 0.5rem;
    }
    
    .filter-badges {
        text-align: center;
        margin-top: 1rem;
    }
    
    .filter-badges .badge {
        display: block;
        margin-bottom: 0.25rem;
    }
}

/* Loading spinner responsivo */
.loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

@media (max-width: 768px) {
    .loading-spinner {
        top: 60%;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .navbar,
    .btn,
    .alert,
    .pagination {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .table {
        font-size: 12px;
    }
    
    .card {
        border: 1px solid #000;
        box-shadow: none;
    }
}

/* Acessibilidade */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode (se implementado futuramente) */

/* Utility classes responsivas */
@media (max-width: 576px) {
    .d-sm-none { display: none !important; }
    .text-sm-center { text-align: center !important; }
    .mb-sm-3 { margin-bottom: 1rem !important; }
}

@media (max-width: 768px) {
    .d-md-none { display: none !important; }
    .text-md-center { text-align: center !important; }
    .mb-md-3 { margin-bottom: 1rem !important; }
}

@media (max-width: 992px) {
    .d-lg-none { display: none !important; }
    .text-lg-center { text-align: center !important; }
    .mb-lg-3 { margin-bottom: 1rem !important; }
}
