/* ===================================
   RESPONSIVE CSS - BRASSERVIÇOS
   Estilos responsivos complementares
   =================================== */

/* ===================================
   EXTRA SMALL DEVICES (< 400px)
   Dispositivos muito pequenos
   =================================== */
@media (max-width: 399.98px) {
  .container {
    padding-right: 8px;
    padding-left: 8px;
  }
  
  .navbar-brand {
    font-size: 1.1rem;
  }
  
  .navbar-brand img {
    max-height: 30px;
  }
  
  .hero-section {
    padding: 1.5rem 0;
  }
  
  .hero-section h1 {
    font-size: 1.75rem !important;
    line-height: 1.2;
  }
  
  .hero-section h2 {
    font-size: 1.1rem !important;
    line-height: 1.3;
  }
  
  .hero-section p {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }
  
  .hero-buttons {
    gap: 0.75rem;
  }
  
  .btn {
    display: block;
    width: 100%;
    margin-bottom: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
  
  .btn-lg {
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
  }
  
  .section {
    padding: 1.5rem 0;
  }
  
  .section-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }
  
  .step-card,
  .category-card .card-body,
  .professional-card,
  .testimonial-card {
    padding: 1rem;
  }
  
  .step-number {
    width: 2rem;
    height: 2rem;
    line-height: 2rem;
    font-size: 1rem;
  }
  
  .professional-card .rating .rating-count {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
  }
  
  .service-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .service-actions .btn {
    width: 100%;
  }
  
  .testimonial-author {
    flex-direction: column;
    text-align: center;
  }
  
  .testimonial-author .avatar {
    margin-right: 0;
    margin-bottom: 0.75rem;
  }
  
  .footer {
    padding: 1.5rem 0 1rem;
  }
  
  .footer h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    margin-top: 1.5rem;
  }
  
  .footer h4:first-child {
    margin-top: 0;
  }
  
  .social-icons {
    justify-content: center;
    margin-top: 1rem;
  }
  
  .social-icons a {
    width: 2rem;
    height: 2rem;
    font-size: 0.8rem;
  }
}

/* ===================================
   SMALL DEVICES (400px - 575px)
   Smartphones pequenos
   =================================== */
@media (min-width: 400px) and (max-width: 575.98px) {
  .hero-stats {
    margin-top: 2rem;
  }
  
  .hero-stats .h3 {
    font-size: 1.5rem;
  }
  
  .card-header {
    padding: 1rem;
    font-size: 0.9rem;
  }
  
  .card-body {
    padding: 1.25rem;
  }
  
  .professional-card h3,
  .professional-card h5 {
    font-size: 1.1rem;
  }
  
  .service-info .info-label {
    min-width: 90px;
    font-size: 0.85rem;
  }
  
  .service-info .info-value {
    font-size: 0.9rem;
  }
  
  .dropdown-menu {
    min-width: 200px;
  }
  
  .navbar-nav .dropdown-menu {
    position: static;
    float: none;
    width: 100%;
    margin-top: 0;
    background-color: var(--light-color);
    border: none;
    border-radius: 0;
    box-shadow: none;
  }
}

/* ===================================
   MEDIUM DEVICES (576px - 991px)
   Tablets e smartphones grandes
   =================================== */
@media (min-width: 576px) and (max-width: 991.98px) {
  .hero-section {
    text-align: center;
  }
  
  .hero-buttons {
    justify-content: center;
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .hero-image {
    margin-top: 2rem;
  }
  
  .professional-card .category,
  .professional-card .city {
    font-size: 0.85rem;
  }
  
  .professional-card h3,
  .professional-card h5 {
    font-size: 1.15rem;
  }
  
  .testimonial-card {
    height: auto;
    min-height: 250px;
  }
  
  .footer .row > div {
    margin-bottom: 2rem;
  }
  
  .footer h4 {
    margin-top: 1rem;
  }
  
  .footer .col-md-4:first-child h4 {
    margin-top: 0;
  }
  
  /* Grid adjustments */
  .col-6.col-md-4.col-lg-3 {
    flex: 0 0 50%;
    max-width: 50%;
  }
  
  .col-md-4 {
    flex: 0 0 100%;
    max-width: 100%;
    margin-bottom: 1.5rem;
  }
  
  .col-md-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  
  .col-md-6.col-lg-4 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

/* ===================================
   LARGE DEVICES (992px - 1199px)
   Desktops pequenos
   =================================== */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .hero-buttons {
    justify-content: flex-start;
  }
  
  .professional-card {
    min-height: 320px;
  }
  
  .testimonial-card {
    min-height: 280px;
  }
  
  .step-card {
    min-height: 220px;
  }
}

/* ===================================
   EXTRA LARGE DEVICES (> 1400px)
   Telas grandes e ultra-wide
   =================================== */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
  
  .hero-section {
    padding: 6rem 0;
  }
  
  .hero-section h1 {
    font-size: 4.5rem;
    line-height: 1.1;
  }
  
  .hero-section h2 {
    font-size: 2.5rem;
  }
  
  .section {
    padding: 5rem 0;
  }
  
  .section-title {
    font-size: 2.5rem;
  }
  
  .hero-image img {
    max-height: 600px;
  }
  
  .step-card,
  .professional-card,
  .testimonial-card {
    padding: 2.5rem;
  }
  
  .category-card .card-body {
    padding: 2rem;
  }
}

/* ===================================
   LANDSCAPE ORIENTATION
   Dispositivos em modo paisagem
   =================================== */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-section {
    padding: 2rem 0;
  }
  
  .hero-section h1 {
    font-size: 2.5rem;
  }
  
  .hero-section h2 {
    font-size: 1.75rem;
  }
  
  .section {
    padding: 2rem 0;
  }
  
  .navbar {
    padding: 0.5rem 0;
  }
  
  .modal-dialog {
    margin: 1rem auto;
  }
}

/* ===================================
   NAVIGATION SPECIFIC
   Navegação responsiva específica
   =================================== */
@media (max-width: 991.98px) {
  .navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
  }
  
  .navbar-toggler:focus {
    box-shadow: none;
  }
  
  .navbar-collapse {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
  }
  
  .navbar-nav {
    padding: 0;
  }
  
  .navbar-nav .nav-link {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin: 0.125rem 0;
  }
  
  .navbar-nav .nav-item.dropdown .dropdown-menu {
    background-color: var(--light-color);
    border: none;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    box-shadow: var(--box-shadow);
  }
  
  .notification-badge {
    position: relative;
    top: auto;
    right: auto;
    margin-left: 0.5rem;
  }
}

/* ===================================
   FORM RESPONSIVE ENHANCEMENTS
   Melhorias responsivas para formulários
   =================================== */
@media (max-width: 575.98px) {
  .form-label {
    font-size: 0.9rem;
    font-weight: 600;
  }
  
  .form-control,
  .form-select {
    font-size: 0.9rem;
    padding: 0.75rem;
  }
  
  .form-control:focus,
  .form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.15);
  }
  
  .input-group {
    flex-direction: column;
  }
  
  .input-group .form-control,
  .input-group .form-select {
    border-radius: 0.5rem !important;
    margin-bottom: 0.5rem;
  }
  
  .input-group-text {
    border-radius: 0.5rem !important;
    width: 100%;
    justify-content: center;
  }
}

/* ===================================
   DASHBOARD RESPONSIVE
   Ajustes para dashboards
   =================================== */
@media (max-width: 767.98px) {
  .dashboard-stats {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .stat-card {
    display: flex;
    align-items: center;
    padding: 1.25rem;
  }
  
  .stat-card .stat-icon {
    margin-right: 1rem;
    font-size: 2rem;
  }
  
  .stat-card .stat-content {
    flex-grow: 1;
  }
  
  .stat-card .stat-value {
    font-size: 1.75rem;
  }
  
  .service-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .service-status {
    align-self: flex-start;
  }
}

/* ===================================
   TABLE RESPONSIVE
   Tabelas responsivas
   =================================== */
@media (max-width: 767.98px) {
  .table-responsive {
    border: none;
  }
  
  .table {
    font-size: 0.875rem;
  }
  
  .table th,
  .table td {
    padding: 0.5rem;
    white-space: nowrap;
  }
  
  .table th {
    font-size: 0.8rem;
  }
  
  /* Stack table on mobile */
  .table-stack thead {
    display: none;
  }
  
  .table-stack,
  .table-stack tbody,
  .table-stack tr,
  .table-stack td {
    display: block;
    width: 100%;
  }
  
  .table-stack tr {
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    overflow: hidden;
  }
  
  .table-stack td {
    border: none;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    padding-left: 50% !important;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }
  
  .table-stack td:before {
    content: attr(data-label);
    position: absolute;
    left: 0.75rem;
    width: 45%;
    padding-right: 0.5rem;
    white-space: nowrap;
    font-weight: 600;
    color: var(--gray-color);
  }
  
  .table-stack td:last-child {
    border-bottom: none;
  }
}

/* ===================================
   PRINT STYLES
   Estilos para impressão
   =================================== */
@media print {
  .navbar,
  .footer,
  .hero-section,
  .cta,
  .btn,
  .no-print,
  .notification-badge,
  .dropdown-toggle::after {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.4;
    color: #000;
    background-color: #fff;
  }
  
  .container {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
  }
  
  .card,
  .professional-card,
  .service-card {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
    margin-bottom: 1rem;
  }
  
  .card-header {
    background-color: #f8f9fa !important;
    color: #000;
  }
  
  h1, h2, h3, h4, h5, h6 {
    color: #000;
    page-break-after: avoid;
  }
  
  p, li {
    orphans: 3;
    widows: 3;
  }
  
  .section-title {
    border-bottom: 2px solid #ddd;
    padding-bottom: 0.5rem;
  }
  
  .professional-card .rating {
    color: #000 !important;
  }
  
  .badge {
    border: 1px solid #ddd;
    color: #000 !important;
    background-color: #f8f9fa !important;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
  
  abbr[title]:after {
    content: " (" attr(title) ")";
  }
  
  /* Don't show link URLs for internal links */
  a[href^="#"]:after,
  a[href^="javascript:"]:after {
    content: "";
  }
}

/* ===================================
   ACCESSIBILITY ENHANCEMENTS
   Melhorias de acessibilidade
   =================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .hero-section::before {
    animation: none;
  }
  
  .notification-badge {
    animation: none;
  }
}

@media (prefers-color-scheme: dark) {
  /* Prepared for future dark mode implementation */
  .card {
    background-color: #2d3748;
    color: #e2e8f0;
    border-color: #4a5568;
  }
}

/* ===================================
   HIGH DPI DISPLAYS
   Telas de alta resolução
   =================================== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .navbar-brand img,
  .hero-image img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* ===================================
   BROWSER COMPATIBILITY
   Compatibilidade com navegadores antigos
   =================================== */
@supports not (display: grid) {
  .dashboard-stats {
    display: flex;
    flex-wrap: wrap;
    margin-left: -0.75rem;
    margin-right: -0.75rem;
  }
  
  .dashboard-stats > * {
    flex: 0 0 calc(33.333% - 1.5rem);
    margin-left: 0.75rem;
    margin-right: 0.75rem;
    margin-bottom: 1.5rem;
  }
}

@supports not (object-fit: cover) {
  .hero-image img {
    width: 100%;
    height: 400px;
  }
}