@tailwind base;
@tailwind components;
@tailwind utilities;

/* ==============================================
   FORM FIELDS - Estilos globais para formulários
   ============================================== */

/* Custom styles for better form visibility */
.form-control,
.m-input,
.select2-container--default .select2-selection--single {
    background-color: #f5f5f5 !important;
}

/* Readonly fields - slightly different shade */
.form-control[readonly],
.m-input[readonly],
.m-input--solid {
    background-color: #e8e8e8 !important;
}

/* Datepicker input - mesmo background dos outros campos */
.input-group.date .form-control[readonly],
input[name="birth_date"] {
    background-color: #f5f5f5 !important;
    cursor: pointer !important;
}

/* Input group text (ícones) */
.input-group-text {
    background-color: #f5f5f5 !important;
    border-color: #e2e5ec !important;
}

/* Focus state */
.form-control:focus,
.m-input:focus {
    background-color: #ffffff !important;
}

/* Label sempre acima do campo */
.form-group label {
    display: block !important;
    margin-bottom: 0.5rem !important;
}

/* Invalid feedback */
.invalid-feedback {
    display: block;
}

/* ==============================================
   SELECT2 - Estilos globais para Select2
   ============================================== */

.select2-container--default .select2-selection--single {
    border: 1px solid #e2e5ec !important;
    height: 38px !important;
    min-height: 38px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 36px !important;
    color: #495057 !important;
    padding-left: 12px !important;
    padding-top: 0 !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 38px !important;
    top: 0 !important;
    right: 1px !important;
    width: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #888 transparent transparent transparent !important;
    border-style: solid !important;
    border-width: 5px 4px 0 4px !important;
    height: 0 !important;
    left: 50% !important;
    margin-left: -4px !important;
    margin-top: 0 !important;
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 0 !important;
}

.select2-container--default .select2-selection--single .select2-selection__clear {
    height: 38px !important;
    line-height: 36px !important;
    margin-right: 30px !important;
}

.select2-container {
    width: 100% !important;
    display: block !important;
}

.select2-container--default .select2-results__option {
    background-color: #ffffff;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #716aca !important;
}

/* ==============================================
   DATEPICKER - Estilos globais
   ============================================== */

.datepicker table tr td,
.datepicker table tr td.day {
    background-color: #ffffff !important;
}

/* ==============================================
   WIZARD - Estilos globais para wizards
   ============================================== */

.wizard-step {
    display: none;
}

.wizard-step.current {
    display: block;
}

/* Client type sections */
.client-type-section {
    display: none;
    transition: all 0.3s ease;
}

.client-type-section.show {
    display: block;
}

/* Wizard form actions - espaçamento e alinhamento dos botões */
.m-portlet__foot.m--margin-top-40 {
    margin-top: 20px !important;
    padding: 20px 30px !important;
    background-color: #f7f8fa;
    border-top: 1px solid #e2e5ec;
}

.m-form__actions .row {
    margin-left: 0;
    margin-right: 0;
}

.m-form__actions .col-lg-6 {
    padding-left: 0;
    padding-right: 0;
}

/* ==============================================
   DATATABLE - Estilos para lista de clientes
   ============================================== */

/* mDatatable customization */
.m-datatable__table {
    width: 100%;
    table-layout: auto;
}

/* Prevenir scroll horizontal */
.m-portlet__body {
    overflow-x: hidden;
}

.m-datatable {
    overflow: visible;
}

/* Permitir overflow APENAS nas células de ações para dropdowns */
.m-datatable__cell--center {
    overflow: visible !important;
}

/* Garantir que checkbox não seja cortado */
.m-datatable__row .m-datatable__cell:first-child,
.m-datatable__head .m-datatable__cell:first-child {
    padding: 1rem 1.25rem !important;
    overflow: visible !important;
}

/* Avatar styling */
.client-avatar {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.client-avatar .symbol {
    width: 40px;
    height: 40px;
    border-radius: 0.42rem;
    background-color: rgba(54, 153, 255, 0.1);
    color: #369fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 14px;
    flex-shrink: 0;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==============================================
   DROPDOWN FILTERS - Filtros da lista
   ============================================== */

.m-dropdown__wrapper {
    min-width: 280px !important;
}

.m-nav__section-text {
    color: #716aca;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filter links styling */
.filter-link {
    transition: all 0.3s ease;
    border-radius: 4px;
    margin: 0 0.5rem;
}

.filter-link:hover {
    background-color: #f7f8fa !important;
    color: #5867dd !important;
}

.filter-link.active {
    background-color: #f1f4ff !important;
    color: #5867dd !important;
    font-weight: 500;
}

.filter-link .m-nav__link-icon {
    color: #a7abc3;
    font-size: 1.1rem;
}

.filter-link.active .m-nav__link-icon,
.filter-link:hover .m-nav__link-icon {
    color: #5867dd !important;
}

.m-nav__link-text {
    color: #74788d;
    font-size: 0.95rem;
}

.filter-link.active .m-nav__link-text {
    color: #5867dd !important;
    font-weight: 500;
}

.select2-dropdown-filter {
    font-size: 0.95rem !important;
}

.m-dropdown__content .form-group label {
    margin-bottom: 0.5rem;
    color: #575962;
}

/* Search bar styling */
.m-input-icon--left .form-control {
    padding-left: 2.5rem;
}

/* ==============================================
   RESPONSIVE - Media queries
   ============================================== */

@media (max-width: 768px) {
    /* Search input on mobile */
    .m-input-icon .form-control {
        height: 48px !important;
        font-size: 1rem !important;
    }

    .m-input-icon__icon {
        font-size: 1.3rem;
    }

    /* Dropdown filters */
    .m-dropdown__wrapper {
        min-width: 260px !important;
    }

    .select2-container--default .select2-selection--single {
        height: 44px !important;
        padding: 0.5rem !important;
        font-size: 1rem !important;
    }

    .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 44px !important;
        font-size: 1rem !important;
    }

    .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: 42px !important;
    }

    /* Container adjustments */
    .m-portlet__body {
        padding: 1rem !important;
    }

    .m-form.m-form--label-align-right {
        margin-bottom: 1.5rem !important;
    }

    /* Search bar full width on mobile */
    .m-input-icon--left {
        max-width: 100% !important;
    }

    /* Botões do wizard em mobile */
    .m-portlet__foot.m--margin-top-40 {
        padding: 15px !important;
    }

    .m-form__actions .col-lg-6 {
        text-align: center !important;
        margin-bottom: 10px;
    }

    .m-form__actions .col-lg-6:last-child {
        margin-bottom: 0;
    }

    .m-form__actions .btn {
        width: 100% !important;
        max-width: 300px !important;
    }

    /* Padding nos forms do wizard em mobile */
    .m-wizard__form-step {
        padding: 20px 15px !important;
    }
}
.m-widget14{
    padding-bottom: 50px !important;
    background-color: red;
}

/* ==============================================
   CLIENT SHOW PAGE STYLES
   ============================================== */

/* Profile picture styles */
.m-card-profile__pic-pic--lg {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    margin: 0 auto;
}

/* Timeline styles */
.m-timeline-3__item {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed #ebedf2;
}

.m-timeline-3__item:last-child {
    border-bottom: none;
}

/* Widget number styles */
.m-widget1__number {
    font-size: 1.5rem;
    font-weight: 600;
}

/* WhatsApp button styles */
.whatsapp-btn {
    background-color: #25D366 !important;
    border-color: #25D366 !important;
    color: white !important;
}

.whatsapp-btn:hover {
    background-color: #1da851 !important;
    border-color: #1da851 !important;
    color: white !important;
}

/* Widget14 styles */
.m-widget14 {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 15px;
}

.m-widget14__title {
    font-size: 24px;
    font-weight: 600;
    color: #5867dd;
    margin: 0;
}

.m-widget14__desc {
    color: #74788d;
    font-size: 12px;
    text-transform: uppercase;
}

.m-widget14__stat {
    font-size: 11px;
    margin-top: 5px;
}

/* Widget26 styles - Enhanced card widgets */
.m-widget26 {
    text-align: center;
    padding: 20px 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.m-widget26:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.m-widget26__number {
    font-size: 24px;
    font-weight: 700;
    color: #3d4465;
    margin-bottom: 8px;
}

.m-widget26__number small {
    font-size: 12px;
    color: #74788d;
    font-weight: 400;
    display: block;
    margin-top: 2px;
}

.m-widget26__desc {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.m-widget26__icon {
    font-size: 18px;
}

.m-widget26__text {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Widget15 styles - Progress widgets */
.m-widget15 {
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.m-widget15__item {
    text-align: center;
}

.m-widget15__stats {
    font-size: 32px;
    font-weight: 700;
    color: #3d4465;
    display: block;
    margin-bottom: 5px;
}

.m-widget15__text {
    font-size: 14px;
    font-weight: 600;
    color: #74788d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.m-widget15__change {
    font-size: 12px;
    color: #74788d;
    margin-top: 10px;
    display: block;
}

.m-widget15__change i {
    margin-right: 5px;
}

/* ==============================================
   CLIENT SHOW PAGE - Estilos para página de cliente
   ============================================== */

/* Professional Metronic-based styles */
.client-info-card {
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 15px 1px rgba(69, 65, 78, 0.08);
    margin-bottom: 30px;
}

.client-avatar-lg {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 600;
    color: white;
    margin: 0 auto 1rem;
}

.info-table {
    width: 100%;
    margin: 0;
}

.info-table tr {
    border-bottom: 1px solid #ebedf2;
}

.info-table tr:last-child {
    border-bottom: none;
}

.info-table td {
    padding: 12px 15px;
    vertical-align: top;
}

.info-table td:first-child {
    font-weight: 500;
    color: #74788d;
    width: 35%;
}

.info-table td:last-child {
    color: #48465b;
    font-weight: 400;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #5d78ff;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
}

.activity-content h6 {
    margin: 0 0 5px 0;
    font-weight: 600;
    color: #48465b;
}

.activity-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #74788d;
}

.contract-mini-card {
    background: white;
    border: 1px solid #ebedf2;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.contract-mini-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.contract-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #34bfa3;
}

.contract-status {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.m-tabs-line .nav-link {
    padding: 15px 20px;
    font-weight: 500;
}

.quick-action-btn {
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    margin: 5px;
}

.btn-success-custom {
    background: #34bfa3;
    color: white;
}

.btn-success-custom:hover {
    background: #2fa690;
    color: white;
    text-decoration: none;
}

.btn-primary-custom {
    background: #5d78ff;
    color: white;
}

.btn-primary-custom:hover {
    background: #4c63d2;
    color: white;
    text-decoration: none;
}

.btn-warning-custom {
    background: #ffb822;
    color: white;
}

.btn-warning-custom:hover {
    background: #f39c12;
    color: white;
    text-decoration: none;
}

.btn-danger-custom {
    background: #f4516c;
    color: white;
}

.btn-danger-custom:hover {
    background: #e73e57;
    color: white;
    text-decoration: none;
}

/* ==============================================
   LAYOUT - Menu lateral acima de rich editors
   ============================================== */

.note-editor.note-frame {
    position: relative;
    z-index: 1;
    isolation: isolate;
}

.note-editor .note-toolbar {
    position: relative;
    z-index: 2;
}

.note-editor .note-editing-area {
    position: relative;
    z-index: 1;
}

.note-editor .note-dropdown-menu,
.note-popover,
.note-tooltip {
    z-index: 30 !important;
}

body.m-aside-left--minimize #m_aside_left,
body.m-aside-left--minimize #m_aside_left .m-aside-menu {
    z-index: 1060 !important;
}

body.m-aside-left--minimize .m-menu__submenu {
    z-index: 1061 !important;
}
