/* ======================== Custom Styles ============================= */

/* Loading Overlay Global */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}


@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 16px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
}

/* Auth Page Custom Styles */
.auth-left {
    background: linear-gradient(135deg, 
        rgba(79, 127, 255, 0.1) 0%, 
        rgba(79, 127, 255, 0.05) 50%, 
        rgba(79, 127, 255, 0.1) 100%),
        url('../images/bg/login-background.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.auth-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(79, 127, 255, 0.3) 0%, 
        rgba(135, 182, 255, 0.2) 50%, 
        rgba(79, 127, 255, 0.3) 100%);
    backdrop-filter: blur(1px);
}

.auth-left img {
    opacity: 0.8;
    filter: brightness(1.1) contrast(1.1);
    position: relative;
    z-index: 1;
}

/* Password Toggle Styles */
.toggle-password {
    cursor: pointer;
    transition: color 0.3s ease;
    user-select: none;
    z-index: 10;
}

.toggle-password:hover {
    color: #4F7FFF !important;
}

.toggle-password.active {
    color: #4F7FFF !important;
}

/* Button Loading State */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.btn-loading .btn-text {
    opacity: 0;
}

/* Enhanced Form Styles */
.form-control:focus {
    border-color: #4F7FFF;
    box-shadow: 0 0 0 0.2rem rgba(79, 127, 255, 0.25);
}

/* Smooth transitions */
.btn, .form-control, .toggle-password {
    transition: all 0.3s ease;
}

/* Responsividade específica para mensagens */
@media screen and (max-width: 576px) {
    /* Ajustar layout das mensagens em telas muito pequenas */
    .comments-box__content .flex-align.align-items-start {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 8px !important;
    }
    
    .comments-box__content .flex-align.align-items-start .w-32 {
        width: 28px !important;
        height: 28px !important;
        align-self: flex-start;
    }
    
    /* Ajustar texto das mensagens */
    .comments-box__content h6.text-lg {
        font-size: 14px !important;
        line-height: 1.2;
    }
    
    .comments-box__content .text-15 {
        font-size: 13px !important;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    
    /* Reorganizar data e nome */
    .comments-box__content .d-flex.flex-column.flex-sm-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
    }
    
    .comments-box__content small {
        font-size: 8pt !important;
    }
}



/* Module Navigation Mobile Responsive */
@media screen and (min-width: 576px) {
    .module-navigation-wrapper .btn {
        max-width: 100% !important;
        min-height: 48px;
        padding: 10px 16px;
    }
    
    .module-navigation-wrapper .text-truncate {
        max-width: 200px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Mobile Small - Layout empilhado apenas em telas pequenas */
@media screen and (max-width: 575px) {
    .module-navigation-wrapper {
        padding: 16px !important;
    }
    
    .module-navigation-wrapper .row {
        gap: 12px;
    }
    
    .module-navigation-wrapper .col-sm-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .module-navigation-wrapper .prev-module,
    .module-navigation-wrapper .next-module {
        display: flex !important;
        justify-content: center !important;
    }
    
    .module-navigation-wrapper .btn {
        width: 100% !important;
        max-width: none !important;
        min-height: 50px;
        padding: 12px 16px;
        justify-content: center !important;
    }
    
    .module-navigation-wrapper .text-truncate {
        max-width: 220px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .module-navigation-wrapper .current-position {
        order: -1;
        margin-bottom: 16px;
    }
    
    .module-navigation-wrapper .next-module {
        order: 2;
    }
    
    .module-navigation-wrapper .prev-module {
        order: 1;
    }
    
    .module-navigation-wrapper .next-module .btn {
        flex-direction: row-reverse;
    }
    
    .module-navigation-wrapper .next-module .btn .text-sm-end {
        text-align: center !important;
    }
    
    .module-navigation-wrapper .prev-module .btn div,
    .module-navigation-wrapper .next-module .btn div {
        text-align: center !important;
    }
}

/* Mobile optimizations */
@media screen and (max-width: 767px) {
    .loading-spinner {
        width: 40px;
        height: 40px;
        border-width: 4px;
    }
    
    .loading-text {
        font-size: 14px;
    }
}
