/* =============================================
   TaskPro — Estilos Personalizados
   Complemento ao Tailwind CDN
   ============================================= */

/* === RESET BASE === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* === SCROLLBAR GLOBAL === */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* === SIDEBAR TRANSITION === */
#sidebar-panel {
    transition: width 0.25s ease, opacity 0.25s ease;
    overflow-y: auto;
}
#sidebar-icons {
    transition: width 0.25s ease;
}

/* === SIDEBAR ITEM ACTIVO === */
.sidebar-item-active {
    background: #DBEAFE !important;
    color: #1E293B !important;
    font-weight: 600;
    border-left: 3px solid #2563EB;
    margin-left: -3px;
    padding-left: calc(0.5rem + 3px) !important;
}

/* === ÍCONE NAV ACTIVO === */
.nav-icon-active {
    background: #DBEAFE !important;
    color: #2563EB !important;
}

/* === TASK ROW === */
.task-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-bottom: 1px solid #F1F5F9;
    cursor: pointer;
    transition: background 0.12s ease;
    min-height: 44px;
}
.task-row:hover {
    background: #F8FAFF;
}
.task-row:hover .task-actions {
    opacity: 1;
}
.task-row.locked {
    background: #F8FAFF;
}
.task-actions {
    opacity: 0;
    transition: opacity 0.15s ease;
}

/* === CHECKBOX CIRCULAR === */
.tp-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #CBD5E1;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    position: relative;
}
.tp-checkbox:hover {
    border-color: #2563EB;
}
.tp-checkbox.done {
    background: #16A34A;
    border-color: #16A34A;
}
.tp-checkbox.done::after {
    content: '';
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translateY(-1px);
    display: block;
}

/* === INDICADOR DE LOCK === */
.lock-indicator {
    color: #2563EB;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.lock-indicator svg {
    width: 14px;
    height: 14px;
}

/* === STATUS DOT === */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

/* === AVATAR === */
.tp-avatar {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
    user-select: none;
}
.tp-avatar-sm {
    width: 24px;
    height: 24px;
    font-size: 10px;
}
.tp-avatar-md {
    width: 32px;
    height: 32px;
    font-size: 12px;
}
.tp-avatar-lg {
    width: 40px;
    height: 40px;
    font-size: 14px;
}
.tp-avatar-xl {
    width: 56px;
    height: 56px;
    font-size: 18px;
}

/* === DRAG HANDLE === */
.drag-handle {
    cursor: grab;
    color: #CBD5E1;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    transition: color 0.12s ease;
}
.drag-handle:hover {
    color: #94A3B8;
}
.drag-handle:active {
    cursor: grabbing;
}

/* === TOAST NOTIFICATION === */
.tp-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    min-width: 240px;
    max-width: 360px;
    margin-top: 8px;
    pointer-events: all;
}
.tp-toast.success { background: #16A34A; }
.tp-toast.error   { background: #DC2626; }
.tp-toast.info    { background: #2563EB; }
.tp-toast.warning { background: #D97706; }

/* === MODAL OVERLAY === */
.tp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
}
.tp-modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 520px;
    padding: 24px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}
.tp-modal-lg {
    max-width: 720px;
}
.tp-modal-xl {
    max-width: 960px;
}

/* === LOADING SPINNER === */
.tp-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #DBEAFE;
    border-top-color: #2563EB;
    border-radius: 50%;
    animation: tp-spin 0.75s linear infinite;
}
.tp-spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}
@keyframes tp-spin {
    to { transform: rotate(360deg); }
}

/* === TASK GROUP HEADER === */
.group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px 6px;
    position: sticky;
    top: 0;
    background: #EFF6FF;
    z-index: 5;
    border-bottom: 1px solid #E2E8F0;
    cursor: pointer;
    user-select: none;
}
.group-header:hover .add-task-btn {
    opacity: 1;
}
.add-task-btn {
    opacity: 0;
    font-size: 12px;
    color: #94A3B8;
    cursor: pointer;
    margin-left: 8px;
    transition: opacity 0.15s, color 0.15s;
}
.add-task-btn:hover {
    color: #2563EB;
}

/* === TASK GROUP ANIMATION === */
.task-group-tasks {
    overflow: hidden;
}

/* === INPUT ESTILO === */
.tp-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    color: #1E293B;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}
.tp-input:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.tp-input::placeholder {
    color: #94A3B8;
}

/* === BOTÃO PRIMÁRIO === */
.tp-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #2563EB;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    outline: none;
}
.tp-btn-primary:hover { background: #1D4ED8; }
.tp-btn-primary:active { transform: scale(0.98); }
.tp-btn-primary:disabled {
    background: #93C5FD;
    cursor: not-allowed;
}

/* === BOTÃO SECUNDÁRIO === */
.tp-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #F1F5F9;
    color: #475569;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    outline: none;
}
.tp-btn-secondary:hover { background: #E2E8F0; }

/* === BADGE DE NOTIFICAÇÃO === */
.notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    background: #DC2626;
    border: 2px solid #fff;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    padding: 0 3px;
}

/* === DROPDOWN MENU === */
.tp-dropdown {
    position: absolute;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    z-index: 200;
    min-width: 160px;
    padding: 4px 0;
    overflow: hidden;
}
.tp-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
    transition: background 0.1s;
}
.tp-dropdown-item:hover { background: #F1F5F9; }
.tp-dropdown-item.danger { color: #DC2626; }
.tp-dropdown-item.danger:hover { background: #FEF2F2; }
.tp-dropdown-divider {
    height: 1px;
    background: #F1F5F9;
    margin: 4px 0;
}
