/* Estilos Globais */
:root {
    /* Cores Nukki - Branding Oficial */
    --nukki-primary: #254544;       /* Verde escuro principal */
    --nukki-secondary: #5AB5A6;     /* Verde turquesa/água */
    --nukki-dark: #222F2E;          /* Verde muito escuro */
    --nukki-brown: #443025;         /* Marrom terroso */
    --nukki-gray: #9A8D86;          /* Cinza acastanhado */
    --nukki-accent: #F0311C;        /* Vermelho/laranja destaque */

    /* Cores de status (semânticas) */
    --color-green: #28a745;
    --color-yellow: #ffc107;
    --color-red: #F0311C;           /* Usando vermelho Nukki */
    --color-gray: #6c757d;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Classe para Navbar Nukki */
.bg-nukki {
    background-color: var(--nukki-primary) !important;
}

.bg-nukki .navbar-brand,
.bg-nukki .nav-link {
    color: #ffffff !important;
}

.bg-nukki .nav-link:hover {
    color: var(--nukki-secondary) !important;
}

/* Logo Nukki na Navbar */
.navbar-brand img.nukki-logo {
    height: 35px;
    width: auto;
}

/* Cards de Dashboard */
.user-card {
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.user-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.user-card.status-green {
    border-left: 5px solid var(--color-green);
    background-color: #d4edda;
}

.user-card.status-yellow {
    border-left: 5px solid var(--color-yellow);
    background-color: #fff3cd;
}

.user-card.status-red {
    border-left: 5px solid var(--color-red);
    background-color: #f8d7da;
}

.user-card.status-gray {
    border-left: 5px solid var(--color-gray);
    background-color: #e9ecef;
}

.user-card .profile-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.user-card .profile-photo-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--nukki-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    font-weight: bold;
    border: 3px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.user-card .stats {
    font-size: 14px;
}

.user-card .stats .stat-item {
    margin-bottom: 8px;
}

.user-card .completion-rate {
    font-size: 24px;
    font-weight: bold;
    color: #495057;
}

/* Cards de Tarefas */
.task-card {
    border-radius: 8px;
    margin-bottom: 15px;
    transition: all 0.2s;
    cursor: pointer;
}

.task-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.task-card.status-pending {
    border-left: 4px solid #6c757d;
}

.task-card.status-in_progress {
    border-left: 4px solid var(--nukki-primary);
}

.task-card.status-completed {
    border-left: 4px solid #28a745;
    background-color: #f8f9fa;
}

.task-card.status-blocked {
    border-left: 4px solid #ff6b00;
    background-color: #fff8f0;
}

.task-card.overdue {
    border-left: 4px solid #dc3545;
    background-color: #fff5f5;
}

.task-card .task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.task-card .task-title {
    font-weight: 600;
    font-size: 18px;
    margin-bottom: 5px;
}

.task-card .task-meta {
    font-size: 13px;
    color: #6c757d;
}

.task-card .task-assignee {
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-card .assignee-photo {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.task-card .assignee-photo-placeholder {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--nukki-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Status Badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.pending {
    background-color: #6c757d;
    color: white;
}

.status-badge.in_progress {
    background-color: var(--nukki-primary);
    color: white;
}

.status-badge.completed {
    background-color: #28a745;
    color: white;
}

.status-badge.blocked {
    background-color: #ff6b00;
    color: white;
}

/* Category Badges */
.category-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    color: white;
    display: inline-block;
    margin-left: 8px;
    margin-top: 4px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* Comentários */
.comment-item {
    border-left: 3px solid #dee2e6;
    padding-left: 15px;
    margin-bottom: 15px;
}

.comment-item .comment-author {
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.comment-item .comment-author img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-item .comment-date {
    font-size: 12px;
    color: #6c757d;
}

.comment-item .comment-content {
    margin-top: 5px;
    color: #212529;
}

/* Anexos */
.attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    margin-bottom: 8px;
    transition: background-color 0.2s;
}

.attachment-item:hover {
    background-color: #f8f9fa;
}

.attachment-item .attachment-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.attachment-item .attachment-icon {
    font-size: 24px;
    color: var(--nukki-primary);
}

.attachment-item .attachment-name {
    font-weight: 500;
}

.attachment-item .attachment-size {
    font-size: 12px;
    color: #6c757d;
}

/* Responsividade */
@media (max-width: 768px) {
    .user-card {
        margin-bottom: 15px;
    }

    .user-card .profile-photo,
    .user-card .profile-photo-placeholder {
        width: 60px;
        height: 60px;
    }

    .user-card .completion-rate {
        font-size: 20px;
    }
}

/* Loading spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h4 {
    margin-bottom: 10px;
}

/* Progress bar customizada */
.progress-custom {
    height: 25px;
    border-radius: 15px;
    background-color: #e9ecef;
}

.progress-custom .progress-bar {
    border-radius: 15px;
    font-weight: 600;
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

/* Estilos da Página de Perfil */
.profile-photo-large {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--nukki-primary);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.profile-photo-placeholder-large {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background-color: var(--nukki-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 60px;
    font-weight: bold;
    border: 3px solid var(--nukki-primary);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#photoPreview {
    margin-top: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 10px;
}

#photoPreviewImage {
    max-width: 200px;
    max-height: 200px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.btn-outline-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.3);
}

/* Transições suaves */
input.form-control,
textarea.form-control {
    transition: border-color 0.2s, box-shadow 0.2s;
}

input.form-control:focus,
textarea.form-control:focus {
    border-color: var(--nukki-secondary);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Estilos do Kanban */
.kanban-board {
    min-height: calc(100vh - 300px);
}

.kanban-column {
    background-color: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    height: 100%;
}

.kanban-column-header {
    padding: 15px;
    font-weight: 600;
    color: white;
    border-radius: 8px 8px 0 0;
}

.kanban-column-header.status-pending {
    background-color: #6c757d;
}

.kanban-column-header.status-in_progress {
    background-color: var(--nukki-primary);
}

.kanban-column-header.status-blocked {
    background-color: #ff6b00;
}

.kanban-column-header.status-completed {
    background-color: #28a745;
}

.kanban-column-header h5 {
    margin: 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kanban-column-body {
    padding: 15px;
    min-height: 500px;
    transition: background-color 0.2s;
}

.kanban-column-body.drag-over {
    background-color: #e3f2fd;
    border: 2px dashed var(--nukki-primary);
}

.kanban-card {
    background: white;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: move;
    transition: all 0.2s;
    border-left: 4px solid var(--nukki-primary);
}

.kanban-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.kanban-card.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.kanban-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.kanban-card-title {
    font-weight: 600;
    font-size: 14px;
    color: #212529;
    flex: 1;
    margin-right: 10px;
    line-height: 1.4;
}

.kanban-card-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.kanban-card-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--nukki-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.kanban-card-date {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 8px;
}

.kanban-card-date i {
    margin-right: 4px;
}

.kanban-card-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.kanban-card-badges .badge {
    font-size: 11px;
    padding: 3px 8px;
}

/* Responsividade do Kanban */
@media (max-width: 992px) {
    .kanban-board .row {
        flex-direction: column;
    }

    .kanban-column-body {
        min-height: 300px;
    }

    .kanban-column {
        margin-bottom: 20px;
    }
}

/* Estilos da Integração Nukki */
#nukkiPropertyResults.show,
#nukkiOwnerResults.show {
    display: block;
    position: absolute;
    z-index: 1000;
}

#nukkiPropertyResults .dropdown-item,
#nukkiOwnerResults .dropdown-item {
    cursor: pointer;
    padding: 8px 12px;
}

#nukkiPropertyResults .dropdown-item:hover,
#nukkiOwnerResults .dropdown-item:hover {
    background-color: #f8f9fa;
}

.nukki-badge {
    display: inline-block;
    padding: 4px 10px;
    background-color: #e3f2fd;
    color: var(--nukki-primary);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 6px;
    margin-bottom: 6px;
}

.nukki-badge i {
    margin-right: 4px;
}

#taskDetailsNukkiContent p {
    margin-bottom: 8px;
    font-size: 14px;
}

#taskDetailsNukkiContent strong {
    color: #495057;
}

/* ==============================================================================
   SISTEMA DE MENÇÕES E NOTIFICAÇÕES
   ============================================================================== */

/* Mentions - Estilo para usuários mencionados */
.mention {
    background-color: #e7f3ff;
    color: #0d47a1;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mention:hover {
    background-color: #bbdefb;
    color: #01579b;
    text-decoration: none;
}

/* Quill Mention - Dropdown de autocomplete (força light mode) */
.ql-mention-list-container {
    background: white !important;
    color: #212529 !important;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 9999;
}

.ql-mention-list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
    background: white !important;
}

.ql-mention-list-item {
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    color: #212529 !important;
    background-color: white !important;
}

.ql-mention-list-item:hover,
.ql-mention-list-item.selected {
    background-color: #f8f9fa !important;
    color: #000 !important;
}

.mention-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #212529 !important;
}

/* Força light mode em todos os elementos internos do mention */
.ql-mention-list-container *,
.ql-mention-list-item * {
    color: #212529 !important;
    background: transparent !important;
}

/* Notificações Badge - Animação pulse */
#notificationBadge {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.15);
    }
}

/* Notificações Dropdown - Estilo melhorado */
#notificationsList .dropdown-item {
    white-space: normal;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
}

#notificationsList .dropdown-item:last-child {
    border-bottom: none;
}

#notificationsList .dropdown-item:hover {
    background-color: #f8f9fa;
}

#notificationsList .dropdown-item.bg-light {
    background-color: #e7f3ff !important;
    border-left: 3px solid var(--nukki-primary);
}

/* Notificações - Ícones por tipo */
.bi-at { color: var(--nukki-primary); }
.bi-clipboard-check { color: #28a745; }
.bi-arrow-left-right { color: #fd7e14; }
.bi-check-circle { color: #20c997; }
.bi-chat-left-text { color: #6f42c1; }
.bi-pencil-square { color: #0dcaf0; }
.bi-file-earmark-text { color: var(--nukki-primary); }
.bi-file-earmark { color: #6c757d; }

/* Página de Notificações - Cards */
.notification-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.notification-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.notification-card.unread {
    background-color: #f8f9ff;
    border-left: 4px solid var(--nukki-primary);
}

/* Preferências de Notificação - Toggle switches */
.form-check-input:checked {
    background-color: var(--nukki-primary);
    border-color: var(--nukki-primary);
}

.form-check-input:focus {
    border-color: var(--nukki-primary);
    box-shadow: 0 0 0 0.25rem rgba(0, 102, 204, 0.25);
}

/* PWA - Ícones e cores */
:root {
    --primary-color: var(--nukki-primary);
    --primary-dark: #004c99;
    --primary-light: #e7f3ff;
}

/* Mobile - Responsividade */
@media (max-width: 768px) {
    #notificationsList .dropdown-menu {
        min-width: 300px !important;
        max-width: 90vw;
    }

    .mention {
        font-size: 13px;
        padding: 1px 4px;
    }

    .ql-mention-list-container {
        max-height: 200px;
    }
}

/* Menções clicáveis */
a.mention,
.mention-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

a.mention:hover,
.mention-link:hover {
    color: #0056b3;
    text-decoration: underline;
    background-color: rgba(0, 123, 255, 0.1);
}

/* Dark mode support (futuro) */
@media (prefers-color-scheme: dark) {
    .mention {
        background-color: #1a3a52;
        color: #66b3ff;
    }

    a.mention,
    .mention-link {
        color: #66b3ff;
    }

    a.mention:hover,
    .mention-link:hover {
        color: #99d6ff;
        background-color: rgba(102, 179, 255, 0.1);
    }

    .ql-mention-list-container {
        background: #2d3748;
        border-color: #4a5568;
    }

    .ql-mention-list-item:hover,
    .ql-mention-list-item.selected {
        background-color: #3d4a5c;
    }
}

/* ==============================================================================
   FOOTER NUKKI
   ============================================================================== */

.nukki-footer {
    background-color: var(--nukki-primary);
    color: #ffffff;
    padding: 25px 30px;
    margin-top: auto;
}

.nukki-footer .footer-logo {
    height: 30px;
    width: auto;
    opacity: 0.9;
}

.nukki-footer .footer-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
}

.nukki-footer .footer-copyright {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

/* Responsividade do Footer */
@media (max-width: 768px) {
    .nukki-footer {
        padding: 20px 15px;
    }

    .nukki-footer .footer-logo {
        height: 25px;
    }

    .nukki-footer .footer-text,
    .nukki-footer .footer-copyright {
        font-size: 12px;
    }
}

/* ==============================================================================
   PLACEHOLDER COM LOGO NUKKI
   ============================================================================== */

.profile-photo-logo-placeholder {
    border-radius: 50%;
    background-color: var(--nukki-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    padding: 15%;
}

.profile-photo-logo-placeholder img {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

.kanban-card-avatar-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--nukki-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    padding: 4px;
}

.kanban-card-avatar-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.assignee-photo-logo-placeholder {
    border-radius: 50%;
    background-color: var(--nukki-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    padding: 3px;
}

.assignee-photo-logo-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
