/* ==========================================================================
   Utilities - Helpers & Overrides
   ========================================================================== */

/* Spacing */
.mt-0 {
    margin-top: 0 !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.my-3 {
    margin-top: 1rem !important;
    margin-bottom: 1rem !important;
}

/* Text */
.text-center {
    text-align: center !important;
}

.text-right {
    text-align: right !important;
}

.text-muted {
    color: var(--text-secondary) !important;
}

.font-bold {
    font-weight: 700 !important;
}

/* Display - Provided by Bootstrap 5.3.3 CDN.
   DO NOT redefine .d-none, .d-block, .d-flex here!
   Redefining them after Bootstrap breaks responsive utilities
   like d-md-block, d-md-none because CSS source order wins
   when both use !important at equal specificity. */

/* Width */
.w-100 {
    width: 100% !important;
}

@media (min-width: 768px) {
    .w-md-auto {
        width: auto !important;
    }
}

/* Scrollable Area */
.teor-scrollable {
    max-height: 250px;
    overflow-y: auto;
    background-color: #f8f9fa;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) #e9ecef;
}

@media (min-width: 768px) {
    .teor-scrollable {
        max-height: 400px;
    }
}

/* Loading State */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* ==========================================================================
   Responsive Mobile Utilities (Migrated from style.css)
   ========================================================================== */

@media (max-width: 768px) {

    /* Layout helpers */
    .width-100 {
        width: 100%;
    }

    .d-flex-column {
        flex-direction: column;
    }

    /* Actions stacking */
    .atalho-rapido {
        flex-direction: column;
        max-width: 100%;
    }

    .acoes {
        flex-direction: column;
    }

    .acoes a {
        display: block;
    }

    .texto-acoes {
        display: none;
    }

    /* Login full-width */
    .login {
        max-width: unset;
    }

    /* Form touch-friendly sizing */
    .form-group {
        margin-bottom: 1.5rem;
    }

    .form-label {
        font-weight: 600;
        margin-bottom: 0.5rem;
        font-size: 0.95rem;
    }

    .form-control {
        font-size: 16px;
        /* Prevents iOS zoom */
        padding: 0.75rem;
    }

    /* Button touch targets */
    .botao-fundo-escuro,
    .botao-fundo-claro {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
        min-height: 48px;
        /* Better touch area */
        border-radius: 8px;
    }

    /* Title sizing */
    .titulo {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    /* Container padding */
    main.container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .gap-3 {
        gap: 1rem !important;
    }
}