/**
 * Responsividade Mobile-First - Agendly
 * Design responsivo otimizado para todos os dispositivos
 */

/* ============================================
   BREAKPOINTS
   ============================================ */

/* Mobile First - Base (320px+) */
/* Tablet - 768px+ */
/* Desktop - 1024px+ */
/* Large Desktop - 1440px+ */

/* ============================================
   CONTAINER RESPONSIVO
   ============================================ */

.container-responsive {
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--agendly-spacing-md);
}

@media (min-width: 768px) {
    .container-responsive {
        max-width: 750px;
        padding: 0 var(--agendly-spacing-lg);
    }
}

@media (min-width: 1024px) {
    .container-responsive {
        max-width: 970px;
    }
}

@media (min-width: 1440px) {
    .container-responsive {
        max-width: 1200px;
    }
}

/* ============================================
   GRID SYSTEM
   ============================================ */

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 calc(-1 * var(--agendly-spacing-md) / 2);
}

.col {
    flex: 1;
    padding: 0 calc(var(--agendly-spacing-md) / 2);
}

.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
.col-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }

@media (min-width: 768px) {
    .col-md-12 { flex: 0 0 100%; max-width: 100%; }
    .col-md-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
    .col-md-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .col-md-9 { flex: 0 0 75%; max-width: 75%; }
    .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-md-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .col-md-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-md-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
}

@media (min-width: 1024px) {
    .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
    .col-lg-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
    .col-lg-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .col-lg-9 { flex: 0 0 75%; max-width: 75%; }
    .col-lg-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-lg-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
    .col-lg-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-lg-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
    .col-lg-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-lg-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
}

/* ============================================
   NAVBAR RESPONSIVA
   ============================================ */

.navbar {
    padding: var(--agendly-spacing-md) 0;
}

.navbar-brand img {
    height: 40px;
    width: auto;
}

.navbar-nav {
    display: flex;
    flex-direction: column;
    gap: var(--agendly-spacing-sm);
}

.navbar-toggler {
    display: block;
    background: none;
    border: 2px solid var(--agendly-primary);
    border-radius: var(--agendly-radius-sm);
    padding: var(--agendly-spacing-xs) var(--agendly-spacing-sm);
    cursor: pointer;
}

.navbar-toggler-icon {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--agendly-primary);
    position: relative;
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: var(--agendly-primary);
    left: 0;
    transition: all var(--agendly-transition-base);
}

.navbar-toggler-icon::before {
    top: -8px;
}

.navbar-toggler-icon::after {
    bottom: -8px;
}

.navbar-collapse {
    display: none;
}

.navbar-collapse.show {
    display: block;
    margin-top: var(--agendly-spacing-md);
}

@media (min-width: 768px) {
    .navbar-nav {
        flex-direction: row;
        gap: var(--agendly-spacing-lg);
    }
    
    .navbar-toggler {
        display: none;
    }
    
    .navbar-collapse {
        display: flex !important;
        margin-top: 0;
    }
}

/* ============================================
   TABELAS RESPONSIVAS
   ============================================ */

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    table {
        font-size: var(--agendly-font-sm);
    }
    
    table th,
    table td {
        padding: var(--agendly-spacing-xs) var(--agendly-spacing-sm);
    }
    
    /* Transformar tabela em cards em mobile */
    .table-mobile-cards {
        display: block;
    }
    
    .table-mobile-cards thead {
        display: none;
    }
    
    .table-mobile-cards tbody,
    .table-mobile-cards tr,
    .table-mobile-cards td {
        display: block;
        width: 100%;
    }
    
    .table-mobile-cards tr {
        margin-bottom: var(--agendly-spacing-md);
        border: 1px solid var(--agendly-gray-200);
        border-radius: var(--agendly-radius-md);
        padding: var(--agendly-spacing-md);
        background: var(--agendly-white);
    }
    
    .table-mobile-cards td {
        border: none;
        padding: var(--agendly-spacing-xs) 0;
        text-align: left;
    }
    
    .table-mobile-cards td::before {
        content: attr(data-label) ': ';
        font-weight: var(--agendly-font-semibold);
        color: var(--agendly-text-secondary);
    }
}

/* ============================================
   FORMS RESPONSIVOS
   ============================================ */

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
    
    .form-row .col {
        width: 100%;
        margin-bottom: var(--agendly-spacing-md);
    }
    
    .btn {
        width: 100%;
        margin-bottom: var(--agendly-spacing-sm);
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
        border-radius: var(--agendly-radius-md);
        margin-bottom: var(--agendly-spacing-xs);
    }
}

/* ============================================
   CARDS RESPONSIVOS
   ============================================ */

@media (max-width: 768px) {
    .card {
        margin-bottom: var(--agendly-spacing-lg);
    }
    
    .card-body {
        padding: var(--agendly-spacing-md);
    }
}

/* ============================================
   TOUCH-FRIENDLY
   ============================================ */

@media (hover: none) and (pointer: coarse) {
    /* Aumentar área de toque em mobile */
    .btn,
    .dropdown-toggle,
    .modal-close,
    .toast-close {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remover hover effects em touch devices */
    .btn:hover,
    .card:hover {
        transform: none;
    }
    
    /* Melhorar espaçamento para toque */
    .nav-link,
    .dropdown-item {
        padding: var(--agendly-spacing-md);
    }
}

/* ============================================
   UTILITÁRIOS RESPONSIVOS
   ============================================ */

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }

@media (min-width: 768px) {
    .d-md-none { display: none !important; }
    .d-md-block { display: block !important; }
    .d-md-flex { display: flex !important; }
    .d-md-inline { display: inline !important; }
    .d-md-inline-block { display: inline-block !important; }
}

@media (min-width: 1024px) {
    .d-lg-none { display: none !important; }
    .d-lg-block { display: block !important; }
    .d-lg-flex { display: flex !important; }
    .d-lg-inline { display: inline !important; }
    .d-lg-inline-block { display: inline-block !important; }
}

/* Text alignment */
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

@media (min-width: 768px) {
    .text-md-left { text-align: left !important; }
    .text-md-center { text-align: center !important; }
    .text-md-right { text-align: right !important; }
}

/* Spacing utilities */
.mt-auto { margin-top: auto !important; }
.mb-auto { margin-bottom: auto !important; }
.ml-auto { margin-left: auto !important; }
.mr-auto { margin-right: auto !important; }

@media (max-width: 768px) {
    .mt-mobile-0 { margin-top: 0 !important; }
    .mb-mobile-0 { margin-bottom: 0 !important; }
    .p-mobile-0 { padding: 0 !important; }
}

